summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/adabas/BDriver.cxx
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2002-08-01 06:20:03 +0000
committerOcke Janssen <oj@openoffice.org>2002-08-01 06:20:03 +0000
commit3c9f9133cb1a660d16a8a0cb08685fbeafda9b7d (patch)
treec38da0813dcc5128edf1b722d245b968b70fc518 /connectivity/source/drivers/adabas/BDriver.cxx
parent47e38f88fad7c54d8c03cd6cca549b24c689e7f1 (diff)
#101866# check if url is correct
Diffstat (limited to 'connectivity/source/drivers/adabas/BDriver.cxx')
-rw-r--r--connectivity/source/drivers/adabas/BDriver.cxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/connectivity/source/drivers/adabas/BDriver.cxx b/connectivity/source/drivers/adabas/BDriver.cxx
index cf589566adb4..9ad74db8a833 100644
--- a/connectivity/source/drivers/adabas/BDriver.cxx
+++ b/connectivity/source/drivers/adabas/BDriver.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: BDriver.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: oj $ $Date: 2001-10-29 10:23:34 $
+ * last change: $Author: oj $ $Date: 2002-08-01 07:19:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -74,6 +74,9 @@
#ifndef _CONNECTIVITY_OTOOLS_HXX_
#include "odbc/OTools.hxx"
#endif
+#ifndef _DBHELPER_DBEXCEPTION_HXX_
+#include "connectivity/dbexception.hxx"
+#endif
using namespace connectivity;
namespace connectivity
@@ -214,6 +217,9 @@ Reference< XInterface > SAL_CALL ODriver_CreateInstance(const Reference< ::com:
// --------------------------------------------------------------------------------
Reference< XConnection > SAL_CALL ODriver::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
{
+ if ( ! acceptsURL(url) )
+ ::dbtools::throwGenericSQLException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid URL!")) ,*this);
+
if(!m_pDriverHandle)
{
::rtl::OUString aPath;
@@ -244,8 +250,10 @@ sal_Bool SAL_CALL ODriver::acceptsURL( const ::rtl::OUString& url )
return (!url.compareTo(::rtl::OUString::createFromAscii("sdbc:adabas:"),12));
}
// --------------------------------------------------------------------------------
-Sequence< DriverPropertyInfo > SAL_CALL ODriver::getPropertyInfo( const ::rtl::OUString& , const Sequence< PropertyValue >& ) throw(SQLException, RuntimeException)
+Sequence< DriverPropertyInfo > SAL_CALL ODriver::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& ) throw(SQLException, RuntimeException)
{
+ if ( ! acceptsURL(url) )
+ ::dbtools::throwGenericSQLException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid URL!")) ,*this);
return Sequence< DriverPropertyInfo >();
}
// --------------------------------------------------------------------------------
@@ -318,6 +326,9 @@ 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);
+
return getDataDefinitionByConnection(connect(url,info));
}
// -----------------------------------------------------------------------------