summaryrefslogtreecommitdiff
path: root/dbaccess/source
diff options
context:
space:
mode:
authorOcke.Janssen <Ocke.Janssen@oracle.com>2011-01-26 12:26:48 +0100
committerOcke.Janssen <Ocke.Janssen@oracle.com>2011-01-26 12:26:48 +0100
commita6f0350550d96ba8e00e79325a260a63a5899107 (patch)
tree803105157db5910578275773cc1f7f85829b03f6 /dbaccess/source
parent984a233417d1ceb056abeeb6b7f4765c793d5566 (diff)
dba34d: #i108967# introduce new settings into UI and driver config: RespectDriverResultSetType
Diffstat (limited to 'dbaccess/source')
-rw-r--r--dbaccess/source/core/api/RowSetCache.cxx18
-rw-r--r--dbaccess/source/ui/browser/brwctrlr.cxx15
-rw-r--r--[-rwxr-xr-x]dbaccess/source/ui/dlg/DbAdminImpl.cxx1
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.cxx33
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.hrc1
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.hxx1
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.src15
-rw-r--r--dbaccess/source/ui/dlg/dbadmin.cxx2
-rw-r--r--dbaccess/source/ui/inc/dsitems.hxx3
-rw-r--r--dbaccess/source/ui/inc/dsmeta.hxx1
-rw-r--r--dbaccess/source/ui/misc/dsmeta.cxx1
11 files changed, 64 insertions, 27 deletions
diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx
index 2d4355edcaef..7401a1016e53 100644
--- a/dbaccess/source/core/api/RowSetCache.cxx
+++ b/dbaccess/source/core/api/RowSetCache.cxx
@@ -116,11 +116,11 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs,
DBG_CTOR(ORowSetCache,NULL);
// first try if the result can be used to do inserts and updates
+ Reference< XPropertySet> xProp(_xRs,UNO_QUERY);
+ Reference< XPropertySetInfo > xPropInfo = xProp->getPropertySetInfo();
try
{
Reference< XResultSetUpdate> xUp(_xRs,UNO_QUERY_THROW);
- Reference< XPropertySet> xProp(_xRs,UNO_QUERY);
- Reference< XPropertySetInfo > xPropInfo = xProp->getPropertySetInfo();
sal_Bool bBookmarkable = xPropInfo->hasPropertyByName(PROPERTY_ISBOOKMARKABLE) &&
any2bool(xProp->getPropertyValue(PROPERTY_ISBOOKMARKABLE)) && Reference< XRowLocate >(_xRs, UNO_QUERY).is();
if ( bBookmarkable )
@@ -139,14 +139,22 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs,
{
(void)ex;
}
- _xRs->beforeFirst();
+ try
+ {
+ if ( xPropInfo->hasPropertyByName(PROPERTY_RESULTSETTYPE) &&
+ ::comphelper::getINT32(xProp->getPropertyValue(PROPERTY_RESULTSETTYPE)) != ResultSetType::FORWARD_ONLY)
+ _xRs->beforeFirst();
+ }
+ catch(const SQLException& e)
+ {
+ (void)e;
+ }
// check if all keys of the updateable table are fetched
sal_Bool bAllKeysFound = sal_False;
sal_Int32 nTablesCount = 0;
- Reference< XPropertySet> xProp(_xRs,UNO_QUERY);
- Reference< XPropertySetInfo > xPropInfo = xProp->getPropertySetInfo();
+
sal_Bool bNeedKeySet = !(xPropInfo->hasPropertyByName(PROPERTY_ISBOOKMARKABLE) &&
any2bool(xProp->getPropertyValue(PROPERTY_ISBOOKMARKABLE)) && Reference< XRowLocate >(_xRs, UNO_QUERY).is() );
bNeedKeySet = bNeedKeySet || (xPropInfo->hasPropertyByName(PROPERTY_RESULTSETCONCURRENCY) &&
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index 103267154da0..fdb225d620c9 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -760,11 +760,18 @@ sal_Bool SbaXDataBrowserController::reloadForm( const Reference< XLoadable >& _r
Reference< XWarningsSupplier > xWarnings( _rxLoadable, UNO_QUERY );
if ( xWarnings.is() )
{
- SQLExceptionInfo aInfo( xWarnings->getWarnings() );
- if ( aInfo.isValid() )
+ try
+ {
+ SQLExceptionInfo aInfo( xWarnings->getWarnings() );
+ if ( aInfo.isValid() )
+ {
+ showError( aInfo );
+ impl_checkForCannotSelectUnfiltered( aInfo );
+ }
+ }
+ catch(const SQLException& e)
{
- showError( aInfo );
- impl_checkForCannotSelectUnfiltered( aInfo );
+ (void)e;
}
}
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index 797cb73eb021..cbcd504c5cac 100755..100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -204,6 +204,7 @@ ODbDataSourceAdministrationHelper::ODbDataSourceAdministrationHelper(const Refer
m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_DOSLINEENDS, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PreferDosLikeLineEnds" ) ) ) );
m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_SOCKET, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LocalSocket" ) ) ) );
m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_NAMED_PIPE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NamedPipe" ) ) ) );
+ m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_RESPECTRESULTSETTYPE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RespectDriverResultSetType" ) ) ) );
// special settings for adabas
m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_SHUTSERVICE, ::rtl::OUString::createFromAscii("ShutdownDatabase")));
diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx
index 1516c735f009..ae8ded9dd79b 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.cxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.cxx
@@ -95,6 +95,7 @@ namespace dbaui
,m_pIgnoreCurrency(NULL)
,m_pEscapeDateTime(NULL)
,m_pPrimaryKeySupport(NULL)
+ ,m_pRespectDriverResultSetType(NULL)
,m_pBooleanComparisonModeLabel( NULL )
,m_pBooleanComparisonMode( NULL )
,m_pMaxRowScanLabel( NULL )
@@ -206,6 +207,7 @@ namespace dbaui
DELETEZ( m_pIgnoreCurrency );
DELETEZ( m_pEscapeDateTime );
DELETEZ( m_pPrimaryKeySupport );
+ DELETEZ( m_pRespectDriverResultSetType );
DELETEZ( m_pBooleanComparisonModeLabel );
DELETEZ( m_pBooleanComparisonMode );
DELETEZ( m_pMaxRowScanLabel );
@@ -219,21 +221,22 @@ namespace dbaui
// for easier maintainance, write the table in this form, then copy it to m_aBooleanSettings
BooleanSettingDesc aSettings[] = {
- { &m_pIsSQL92Check, CB_SQL92CHECK, DSID_SQL92CHECK, false },
- { &m_pAppendTableAlias, CB_APPENDTABLEALIAS, DSID_APPEND_TABLE_ALIAS, false },
- { &m_pAsBeforeCorrelationName, CB_AS_BEFORE_CORR_NAME, DSID_AS_BEFORE_CORRNAME, false },
- { &m_pEnableOuterJoin, CB_ENABLEOUTERJOIN, DSID_ENABLEOUTERJOIN, false },
- { &m_pIgnoreDriverPrivileges, CB_IGNOREDRIVER_PRIV, DSID_IGNOREDRIVER_PRIV, false },
- { &m_pParameterSubstitution, CB_PARAMETERNAMESUBST, DSID_PARAMETERNAMESUBST, false },
- { &m_pSuppressVersionColumn, CB_SUPPRESVERSIONCL, DSID_SUPPRESSVERSIONCL, true },
- { &m_pCatalog, CB_CATALOG, DSID_CATALOG, false },
- { &m_pSchema, CB_SCHEMA, DSID_SCHEMA, false },
- { &m_pIndexAppendix, CB_IGNOREINDEXAPPENDIX, DSID_INDEXAPPENDIX, false },
- { &m_pDosLineEnds, CB_DOSLINEENDS, DSID_DOSLINEENDS, false },
- { &m_pCheckRequiredFields, CB_CHECK_REQUIRED, DSID_CHECK_REQUIRED_FIELDS, false },
- { &m_pIgnoreCurrency, CB_IGNORECURRENCY, DSID_IGNORECURRENCY, false },
- { &m_pEscapeDateTime, CB_ESCAPE_DATETIME, DSID_ESCAPE_DATETIME, false },
- { &m_pPrimaryKeySupport, CB_PRIMARY_KEY_SUPPORT, DSID_PRIMARY_KEY_SUPPORT, false },
+ { &m_pIsSQL92Check, CB_SQL92CHECK, DSID_SQL92CHECK, false },
+ { &m_pAppendTableAlias, CB_APPENDTABLEALIAS, DSID_APPEND_TABLE_ALIAS, false },
+ { &m_pAsBeforeCorrelationName, CB_AS_BEFORE_CORR_NAME, DSID_AS_BEFORE_CORRNAME, false },
+ { &m_pEnableOuterJoin, CB_ENABLEOUTERJOIN, DSID_ENABLEOUTERJOIN, false },
+ { &m_pIgnoreDriverPrivileges, CB_IGNOREDRIVER_PRIV, DSID_IGNOREDRIVER_PRIV, false },
+ { &m_pParameterSubstitution, CB_PARAMETERNAMESUBST, DSID_PARAMETERNAMESUBST, false },
+ { &m_pSuppressVersionColumn, CB_SUPPRESVERSIONCL, DSID_SUPPRESSVERSIONCL, true },
+ { &m_pCatalog, CB_CATALOG, DSID_CATALOG, false },
+ { &m_pSchema, CB_SCHEMA, DSID_SCHEMA, false },
+ { &m_pIndexAppendix, CB_IGNOREINDEXAPPENDIX, DSID_INDEXAPPENDIX, false },
+ { &m_pDosLineEnds, CB_DOSLINEENDS, DSID_DOSLINEENDS, false },
+ { &m_pCheckRequiredFields, CB_CHECK_REQUIRED, DSID_CHECK_REQUIRED_FIELDS, false },
+ { &m_pIgnoreCurrency, CB_IGNORECURRENCY, DSID_IGNORECURRENCY, false },
+ { &m_pEscapeDateTime, CB_ESCAPE_DATETIME, DSID_ESCAPE_DATETIME, false },
+ { &m_pPrimaryKeySupport, CB_PRIMARY_KEY_SUPPORT, DSID_PRIMARY_KEY_SUPPORT, false },
+ { &m_pRespectDriverResultSetType, CB_RESPECTRESULTSETTYPE,DSID_RESPECTRESULTSETTYPE, false },
{ NULL, 0, 0, false }
};
diff --git a/dbaccess/source/ui/dlg/advancedsettings.hrc b/dbaccess/source/ui/dlg/advancedsettings.hrc
index 193fdf5f3853..81c296916b09 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.hrc
+++ b/dbaccess/source/ui/dlg/advancedsettings.hrc
@@ -62,6 +62,7 @@
#define CB_IGNORECURRENCY 14
#define CB_ESCAPE_DATETIME 15
#define CB_PRIMARY_KEY_SUPPORT 16
+#define CB_RESPECTRESULTSETTYPE 17
#define ET_AUTOINCREMENTVALUE 1
#define ET_RETRIEVE_AUTO 2
diff --git a/dbaccess/source/ui/dlg/advancedsettings.hxx b/dbaccess/source/ui/dlg/advancedsettings.hxx
index 07620496b11f..88595832020a 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.hxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.hxx
@@ -73,6 +73,7 @@ namespace dbaui
CheckBox* m_pIgnoreCurrency;
CheckBox* m_pEscapeDateTime;
CheckBox* m_pPrimaryKeySupport;
+ CheckBox* m_pRespectDriverResultSetType;
FixedText* m_pBooleanComparisonModeLabel;
ListBox* m_pBooleanComparisonMode;
diff --git a/dbaccess/source/ui/dlg/advancedsettings.src b/dbaccess/source/ui/dlg/advancedsettings.src
index f30b451025aa..d36a0b777563 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.src
+++ b/dbaccess/source/ui/dlg/advancedsettings.src
@@ -217,6 +217,16 @@
Text [ en-US ] = "Supports primary keys"; \
};
+#define AUTO_RESPECTRESULTSETTYPE(AUTO_Y) \
+ CheckBox CB_RESPECTRESULTSETTYPE \
+ { \
+ Pos = MAP_APPFONT ( 6 , AUTO_Y ) ; \
+ Size = MAP_APPFONT ( ADVANCED_PAGE_X - 12 , CHECKBOX_HEIGHT ) ; \
+ TabStop = TRUE ; \
+ HelpId = HID_DSADMIN_RESPECTRESULTSETTYPE; \
+ Text [ en-US ] = "Ignore the result set type from the database driver"; \
+ };
+
//-------------------------------------------------------------------------
@@ -351,8 +361,9 @@ TabPage PAGE_ADVANCED_SETTINGS_SPECIAL
AUTO_IGNORECURRENCY( 13*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 12*CHECKBOX_HEIGHT + RELATED_CONTROLS )
AUTO_ESCAPE_DATETIME( 14*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS )
AUTO_PRIMARY_KEY_SUPPORT( 15*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 15*CHECKBOX_HEIGHT + RELATED_CONTROLS )
- AUTO_BOOLEANCOMPARISON( 16*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 )
- AUTO_MAXROWSCAN( 17*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 )
+ AUTO_RESPECTRESULTSETTYPE( 16*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 16*CHECKBOX_HEIGHT + RELATED_CONTROLS )
+ AUTO_BOOLEANCOMPARISON( 17*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 15*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 )
+ AUTO_MAXROWSCAN( 18*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 15*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 )
};
//-------------------------------------------------------------------------
diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx
index 1c1b945854ed..f03352497a98 100644
--- a/dbaccess/source/ui/dlg/dbadmin.cxx
+++ b/dbaccess/source/ui/dlg/dbadmin.cxx
@@ -411,6 +411,7 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp
*pCounter++ = new SfxStringItem(DSID_NAMED_PIPE, String());
*pCounter++ = new OptionalBoolItem( DSID_PRIMARY_KEY_SUPPORT );
*pCounter++ = new SfxInt32Item(DSID_MAX_ROW_SCAN, 100);
+ *pCounter++ = new SfxBoolItem( DSID_RESPECTRESULTSETTYPE,sal_False );
// create the pool
static SfxItemInfo __READONLY_DATA aItemInfos[DSID_LAST_ITEM_ID - DSID_FIRST_ITEM_ID + 1] =
@@ -474,6 +475,7 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp
{0,0},
{0,0},
{0,0},
+ {0,0},
{0,0}
};
diff --git a/dbaccess/source/ui/inc/dsitems.hxx b/dbaccess/source/ui/inc/dsitems.hxx
index 6b87bee2a61a..a29e2201f370 100644
--- a/dbaccess/source/ui/inc/dsitems.hxx
+++ b/dbaccess/source/ui/inc/dsitems.hxx
@@ -93,6 +93,7 @@ typedef sal_Int32 ItemID;
#define DSID_NAMED_PIPE 58
#define DSID_PRIMARY_KEY_SUPPORT 59
#define DSID_MAX_ROW_SCAN 60
+#define DSID_RESPECTRESULTSETTYPE 61
// don't forget to adjust DSID_LAST_ITEM_ID below!
@@ -100,7 +101,7 @@ typedef sal_Int32 ItemID;
//= item range. Adjust this if you introduce new items above
#define DSID_FIRST_ITEM_ID DSID_NAME
-#define DSID_LAST_ITEM_ID DSID_MAX_ROW_SCAN
+#define DSID_LAST_ITEM_ID DSID_RESPECTRESULTSETTYPE
#endif // _DBAUI_DATASOURCEITEMS_HXX_
diff --git a/dbaccess/source/ui/inc/dsmeta.hxx b/dbaccess/source/ui/inc/dsmeta.hxx
index 87a93244cd3f..9d1275e073ff 100644
--- a/dbaccess/source/ui/inc/dsmeta.hxx
+++ b/dbaccess/source/ui/inc/dsmeta.hxx
@@ -133,6 +133,7 @@ namespace dbaui
|| has( DSID_ESCAPE_DATETIME )
|| has( DSID_PRIMARY_KEY_SUPPORT )
|| has( DSID_MAX_ROW_SCAN )
+ || has( DSID_RESPECTRESULTSETTYPE )
;
}
diff --git a/dbaccess/source/ui/misc/dsmeta.cxx b/dbaccess/source/ui/misc/dsmeta.cxx
index 052d013f47a4..ad00b052a184 100644
--- a/dbaccess/source/ui/misc/dsmeta.cxx
+++ b/dbaccess/source/ui/misc/dsmeta.cxx
@@ -93,6 +93,7 @@ namespace dbaui
{ DSID_IGNORECURRENCY, "IgnoreCurrency" },
{ DSID_ESCAPE_DATETIME, "EscapeDateTime" },
{ DSID_PRIMARY_KEY_SUPPORT, "PrimaryKeySupport" },
+ { DSID_RESPECTRESULTSETTYPE, "RespectDriverResultSetType" },
{ DSID_MAX_ROW_SCAN, "MaxRowScan" },
{ 0, NULL }
};