summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/ado
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-10-01 12:28:29 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-10-01 12:28:29 +0000
commit0e779477f3218d8b1325eb3e62470f7380c2546c (patch)
tree49f07432f8f482fcc5bc659fdddd8101f15d0a1d /connectivity/source/drivers/ado
parent71faa9e9fd955a238d3060a7f9b64818091a8573 (diff)
CWS-TOOLING: integrate CWS dba31b
Diffstat (limited to 'connectivity/source/drivers/ado')
-rw-r--r--connectivity/source/drivers/ado/AColumns.cxx8
-rw-r--r--connectivity/source/drivers/ado/ADriver.cxx21
-rw-r--r--connectivity/source/drivers/ado/AGroups.cxx11
-rw-r--r--connectivity/source/drivers/ado/AIndexes.cxx14
-rw-r--r--connectivity/source/drivers/ado/AKeys.cxx13
-rw-r--r--connectivity/source/drivers/ado/ATables.cxx10
-rw-r--r--connectivity/source/drivers/ado/AUsers.cxx9
-rw-r--r--connectivity/source/drivers/ado/AViews.cxx15
-rw-r--r--connectivity/source/drivers/ado/Aolevariant.cxx8
9 files changed, 48 insertions, 61 deletions
diff --git a/connectivity/source/drivers/ado/AColumns.cxx b/connectivity/source/drivers/ado/AColumns.cxx
index 3d5a61c997..473f57e681 100644
--- a/connectivity/source/drivers/ado/AColumns.cxx
+++ b/connectivity/source/drivers/ado/AColumns.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: AColumns.cxx,v $
- * $Revision: 1.22 $
+ * $Revision: 1.22.56.1 $
*
* This file is part of OpenOffice.org.
*
@@ -41,6 +41,7 @@
#include <comphelper/property.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbexception.hxx>
+#include "resource/ado_res.hrc"
using namespace connectivity::ado;
using namespace connectivity;
@@ -72,10 +73,7 @@ sdbcx::ObjectType OColumns::appendObject( const ::rtl::OUString&, const Referenc
{
OAdoColumn* pColumn = NULL;
if ( !getImplementation( pColumn, descriptor ) || pColumn == NULL )
- ::dbtools::throwGenericSQLException(
- ::rtl::OUString::createFromAscii( "Could not append column: invalid column descriptor." ),
- static_cast<XTypeProvider*>(this)
- );
+ m_pConnection->throwGenericSQLException( STR_INVALID_COLUMN_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
WpADOColumn aColumn = pColumn->getColumnImpl();
diff --git a/connectivity/source/drivers/ado/ADriver.cxx b/connectivity/source/drivers/ado/ADriver.cxx
index 32978ed581..33c1f80b4a 100644
--- a/connectivity/source/drivers/ado/ADriver.cxx
+++ b/connectivity/source/drivers/ado/ADriver.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ADriver.cxx,v $
- * $Revision: 1.19 $
+ * $Revision: 1.19.56.1 $
*
* This file is part of OpenOffice.org.
*
@@ -38,8 +38,11 @@
#include "ado/adoimp.hxx"
#include <com/sun/star/lang/DisposedException.hpp>
#include "connectivity/dbexception.hxx"
+#include "resource/ado_res.hrc"
+#include "resource/sharedresources.hxx"
+using namespace connectivity;
using namespace connectivity::ado;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
@@ -140,11 +143,20 @@ sal_Bool SAL_CALL ODriver::acceptsURL( const ::rtl::OUString& url )
{
return (!url.compareTo(::rtl::OUString::createFromAscii("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)
{
- if ( !acceptsURL(url) )
- ::dbtools::throwGenericSQLException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid URL!")) ,*this);
+ impl_checkURL_throw(url);
return Sequence< DriverPropertyInfo >();
}
// --------------------------------------------------------------------------------
@@ -201,8 +213,7 @@ Reference< XTablesSupplier > SAL_CALL ODriver::getDataDefinitionByConnection( co
// --------------------------------------------------------------------------------
Reference< XTablesSupplier > SAL_CALL ODriver::getDataDefinitionByURL( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
{
- if ( ! acceptsURL(url) )
- ::dbtools::throwGenericSQLException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid URL!")) ,*this);
+ impl_checkURL_throw(url);
return getDataDefinitionByConnection(connect(url,info));
}
diff --git a/connectivity/source/drivers/ado/AGroups.cxx b/connectivity/source/drivers/ado/AGroups.cxx
index 979fbbe8a1..5e366825f1 100644
--- a/connectivity/source/drivers/ado/AGroups.cxx
+++ b/connectivity/source/drivers/ado/AGroups.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: AGroups.cxx,v $
- * $Revision: 1.12 $
+ * $Revision: 1.12.56.1 $
*
* This file is part of OpenOffice.org.
*
@@ -31,16 +31,16 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_connectivity.hxx"
#include "ado/AGroups.hxx"
-#ifndef _CONNECTIVITY_ADO_GROUP_HXX_
#include "ado/AGroup.hxx"
-#endif
#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;
@@ -73,10 +73,7 @@ sdbcx::ObjectType OGroups::appendObject( const ::rtl::OUString& _rForName, const
{
OAdoGroup* pGroup = NULL;
if ( !getImplementation(pGroup,descriptor) || pGroup == NULL )
- ::dbtools::throwGenericSQLException(
- ::rtl::OUString::createFromAscii( "Could not create group: invalid object descriptor." ),
- static_cast<XTypeProvider*>(this)
- );
+ m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_GROUP_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
m_aCollection.Append( pGroup->getImpl() );
return createObject( _rForName );
diff --git a/connectivity/source/drivers/ado/AIndexes.cxx b/connectivity/source/drivers/ado/AIndexes.cxx
index ae938beb67..0246348e58 100644
--- a/connectivity/source/drivers/ado/AIndexes.cxx
+++ b/connectivity/source/drivers/ado/AIndexes.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: AIndexes.cxx,v $
- * $Revision: 1.17 $
+ * $Revision: 1.17.56.1 $
*
* This file is part of OpenOffice.org.
*
@@ -39,7 +39,7 @@
#include "TConnection.hxx"
#include <comphelper/types.hxx>
#include <connectivity/dbexception.hxx>
-
+#include "resource/ado_res.hrc"
using namespace ::comphelper;
@@ -71,19 +71,13 @@ sdbcx::ObjectType OIndexes::appendObject( const ::rtl::OUString& _rForName, cons
{
OAdoIndex* pIndex = NULL;
if ( !getImplementation(pIndex,descriptor) || pIndex == NULL )
- ::dbtools::throwGenericSQLException(
- ::rtl::OUString::createFromAscii( "Could not create index: invalid object descriptor." ),
- static_cast<XTypeProvider*>(this)
- );
+ 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));
- ::dbtools::throwGenericSQLException(
- ::rtl::OUString::createFromAscii( "Could not append index." ),
- static_cast<XTypeProvider*>(this)
- );
+ m_pConnection->throwGenericSQLException( STR_INVALID_INDEX_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
}
return new OAdoIndex(isCaseSensitive(),m_pConnection,pIndex->getImpl());
diff --git a/connectivity/source/drivers/ado/AKeys.cxx b/connectivity/source/drivers/ado/AKeys.cxx
index 090987ee3c..abe6bb3113 100644
--- a/connectivity/source/drivers/ado/AKeys.cxx
+++ b/connectivity/source/drivers/ado/AKeys.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: AKeys.cxx,v $
- * $Revision: 1.20 $
+ * $Revision: 1.20.56.1 $
*
* This file is part of OpenOffice.org.
*
@@ -43,6 +43,7 @@
#include "ado/Awrapado.hxx"
#include <comphelper/property.hxx>
#include <connectivity/dbexception.hxx>
+#include "resource/ado_res.hrc"
using namespace ::comphelper;
using namespace connectivity;
@@ -74,10 +75,7 @@ sdbcx::ObjectType OKeys::appendObject( const ::rtl::OUString&, const Reference<
{
OAdoKey* pKey = NULL;
if ( !getImplementation( pKey, descriptor ) || pKey == NULL)
- ::dbtools::throwGenericSQLException(
- ::rtl::OUString::createFromAscii( "Could not create key: invalid object descriptor." ),
- static_cast<XTypeProvider*>(this)
- );
+ m_pConnection->throwGenericSQLException( STR_INVALID_KEY_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
// To pass as column parameter to Key's Apppend method
OLEVariant vOptional;
@@ -103,10 +101,7 @@ sdbcx::ObjectType OKeys::appendObject( const ::rtl::OUString&, const Reference<
{
ADOS::ThrowException(*m_pConnection->getConnection(),static_cast<XTypeProvider*>(this));
// just make sure that an SQLExceptionis thrown here
- ::dbtools::throwGenericSQLException(
- ::rtl::OUString::createFromAscii( "Could not append key." ),
- static_cast<XTypeProvider*>(this)
- );
+ m_pConnection->throwGenericSQLException( STR_INVALID_KEY_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
}
return new OAdoKey(isCaseSensitive(),m_pConnection,pKey->getImpl());
diff --git a/connectivity/source/drivers/ado/ATables.cxx b/connectivity/source/drivers/ado/ATables.cxx
index 46db96151d..384607bdef 100644
--- a/connectivity/source/drivers/ado/ATables.cxx
+++ b/connectivity/source/drivers/ado/ATables.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ATables.cxx,v $
- * $Revision: 1.21 $
+ * $Revision: 1.21.56.1 $
*
* This file is part of OpenOffice.org.
*
@@ -38,14 +38,13 @@
#include <com/sun/star/sdbc/KeyRule.hpp>
#include <com/sun/star/sdbcx/KeyType.hpp>
#include "ado/ACatalog.hxx"
-#ifndef _CONNECTIVITY_ADO_BCONNECTION_HXX_
#include "ado/AConnection.hxx"
-#endif
#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;
@@ -83,10 +82,7 @@ sdbcx::ObjectType OTables::appendObject( const ::rtl::OUString&, const Reference
{
OAdoTable* pTable = NULL;
if ( !getImplementation( pTable, descriptor ) || pTable == NULL )
- ::dbtools::throwGenericSQLException(
- ::rtl::OUString::createFromAscii( "Could not create table: invalid object descriptor." ),
- static_cast<XTypeProvider*>(this)
- );
+ 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()))
diff --git a/connectivity/source/drivers/ado/AUsers.cxx b/connectivity/source/drivers/ado/AUsers.cxx
index 3fb8beb32e..bf66d1d6f8 100644
--- a/connectivity/source/drivers/ado/AUsers.cxx
+++ b/connectivity/source/drivers/ado/AUsers.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: AUsers.cxx,v $
- * $Revision: 1.12 $
+ * $Revision: 1.12.56.1 $
*
* This file is part of OpenOffice.org.
*
@@ -33,11 +33,13 @@
#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;
@@ -70,10 +72,7 @@ sdbcx::ObjectType OUsers::appendObject( const ::rtl::OUString& _rForName, const
{
OUserExtend* pUser = NULL;
if ( !getImplementation( pUser, descriptor ) || pUser == NULL )
- ::dbtools::throwGenericSQLException(
- ::rtl::OUString::createFromAscii( "Could not create user: invalid object descriptor." ),
- static_cast<XTypeProvider*>(this)
- );
+ 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()));
diff --git a/connectivity/source/drivers/ado/AViews.cxx b/connectivity/source/drivers/ado/AViews.cxx
index 12cbd7b034..ed95efea6c 100644
--- a/connectivity/source/drivers/ado/AViews.cxx
+++ b/connectivity/source/drivers/ado/AViews.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: AViews.cxx,v $
- * $Revision: 1.17 $
+ * $Revision: 1.17.56.1 $
*
* This file is part of OpenOffice.org.
*
@@ -34,13 +34,12 @@
#include "ado/AView.hxx"
#include "ado/ATables.hxx"
#include "ado/ACatalog.hxx"
-#ifndef _CONNECTIVITY_ADO_BCONNECTION_HXX_
#include "ado/AConnection.hxx"
-#endif
#include "ado/Awrapado.hxx"
#include "TConnection.hxx"
#include <comphelper/types.hxx>
#include <connectivity/dbexception.hxx>
+#include "resource/ado_res.hrc"
using namespace ::comphelper;
@@ -75,18 +74,12 @@ sdbcx::ObjectType OViews::appendObject( const ::rtl::OUString& _rForName, const
{
OAdoView* pView = NULL;
if ( !getImplementation( pView, descriptor ) || pView == NULL )
- ::dbtools::throwGenericSQLException(
- ::rtl::OUString::createFromAscii( "Could not create view: invalid object descriptor." ),
- static_cast<XTypeProvider*>(this)
- );
+ m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_VIEW_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
WpADOCommand aCommand;
aCommand.Create();
if ( !aCommand.IsValid() )
- ::dbtools::throwGenericSQLException(
- ::rtl::OUString::createFromAscii( "Could not create view: no command object." ),
- static_cast<XTypeProvider*>(this)
- );
+ m_pCatalog->getConnection()->throwGenericSQLException( STR_VIEW_NO_COMMAND_ERROR,static_cast<XTypeProvider*>(this) );
::rtl::OUString sName( _rForName );
aCommand.put_Name(sName);
diff --git a/connectivity/source/drivers/ado/Aolevariant.cxx b/connectivity/source/drivers/ado/Aolevariant.cxx
index d61b1476b0..650c77a244 100644
--- a/connectivity/source/drivers/ado/Aolevariant.cxx
+++ b/connectivity/source/drivers/ado/Aolevariant.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: Aolevariant.cxx,v $
- * $Revision: 1.15 $
+ * $Revision: 1.15.56.1 $
*
* This file is part of OpenOffice.org.
*
@@ -37,6 +37,8 @@
#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"
using namespace connectivity::ado;
OLEString::OLEString()
@@ -437,8 +439,10 @@ void OLEVariant::ChangeType(VARTYPE vartype, const OLEVariant* pSrc)
0,
vartype ) ) )
{
+ ::connectivity::SharedResources aResources;
+ const ::rtl::OUString sError( aResources.getResourceString(STR_TYPE_NOT_CONVERT));
throw ::com::sun::star::sdbc::SQLException(
- ::rtl::OUString::createFromAscii( "Could not convert type!" ),
+ sError,
NULL,
::rtl::OUString::createFromAscii( "S1000" ),
1000,