summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2001-10-22 10:17:34 +0000
committerOcke Janssen <oj@openoffice.org>2001-10-22 10:17:34 +0000
commit5d7ae175e3e3f074823edbdcb9888db842ddc226 (patch)
tree39873c58a9db0f3b05d26fd1b2373567678613d4 /connectivity
parent1604dd6a9581ab8e61a272365094eb993ac4af4c (diff)
#93555# catalog fixed
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/odbc/ODatabaseMetaData.cxx91
-rw-r--r--connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx12
2 files changed, 42 insertions, 61 deletions
diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx
index 0c426c369a18..674885260366 100644
--- a/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx
+++ b/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ODatabaseMetaData.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: oj $ $Date: 2001-10-22 10:18:23 $
+ * last change: $Author: oj $ $Date: 2001-10-22 11:17:33 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -91,25 +91,6 @@ using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::sdbc;
-#define BEGIN_TRANS \
- try \
- { \
- m_pConnection->createStatement()->execute(::rtl::OUString::createFromAscii("SUBTRANS BEGIN")); \
- } \
- catch(Exception&) \
- { \
- printf("Exception occurced begin trans!\n");\
- }
-
-#define END_TRANS \
- try \
- { \
- m_pConnection->createStatement()->execute(::rtl::OUString::createFromAscii("SUBTRANS END"));\
- } \
- catch(Exception&) \
- { \
- printf("Exception occurced end trans!\n");\
- }
ODatabaseMetaData::ODatabaseMetaData(const SQLHANDLE _pHandle,OConnection* _pCon)
: ::connectivity::ODatabaseMetaDataBase(_pCon)
@@ -141,17 +122,17 @@ ODatabaseMetaData::~ODatabaseMetaData()
// -------------------------------------------------------------------------
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo( ) throw(SQLException, RuntimeException)
{
- BEGIN_TRANS
+
ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
Reference< XResultSet > xRef = pResult;
pResult->openTypeInfo();
- END_TRANS
+
return xRef;
}
// -------------------------------------------------------------------------
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCatalogs( ) throw(SQLException, RuntimeException)
{
- BEGIN_TRANS
+
Reference< XResultSet > xRef;
if(!m_bUseCatalog)
{
@@ -165,7 +146,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCatalogs( ) throw(SQLExc
xRef = pResult;
pResult->openCatalogs();
}
- END_TRANS
+
return xRef;
}
// -------------------------------------------------------------------------
@@ -181,76 +162,76 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCatalogs( ) throw(SQLExc
// -------------------------------------------------------------------------
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getSchemas( ) throw(SQLException, RuntimeException)
{
- BEGIN_TRANS
+
ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
Reference< XResultSet > xRef = pResult;
pResult->openSchemas();
- END_TRANS return xRef;
+ 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)
{
- BEGIN_TRANS
+
ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
Reference< XResultSet > xRef = pResult;
pResult->openColumnPrivileges(m_bUseCatalog ? catalog : Any(),schema,table,columnNamePattern);
- END_TRANS return xRef;
+ 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)
{
- BEGIN_TRANS
+
ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
Reference< XResultSet > xRef = pResult;
pResult->openColumns(m_bUseCatalog ? catalog : Any(),schemaPattern,tableNamePattern,columnNamePattern);
- END_TRANS return xRef;
+ 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)
{
- BEGIN_TRANS
+
ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
Reference< XResultSet > xRef = pResult;
pResult->openTables(m_bUseCatalog ? catalog : Any(),schemaPattern,tableNamePattern,types);
- END_TRANS return xRef;
+ 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)
{
- BEGIN_TRANS
+
ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
Reference< XResultSet > xRef = pResult;
pResult->openProcedureColumns(m_bUseCatalog ? catalog : Any(),schemaPattern,procedureNamePattern,columnNamePattern);
- END_TRANS return xRef;
+ return xRef;
}
// -------------------------------------------------------------------------
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures(
const Any& catalog, const ::rtl::OUString& schemaPattern,
const ::rtl::OUString& procedureNamePattern ) throw(SQLException, RuntimeException)
{
- BEGIN_TRANS
+
ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
Reference< XResultSet > xRef = pResult;
pResult->openProcedures(m_bUseCatalog ? catalog : Any(),schemaPattern,procedureNamePattern);
- END_TRANS return xRef;
+ return xRef;
}
// -------------------------------------------------------------------------
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getVersionColumns(
const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
{
- BEGIN_TRANS
+
ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
Reference< XResultSet > xRef = pResult;
pResult->openVersionColumns(m_bUseCatalog ? catalog : Any(),schema,table);
- END_TRANS return xRef;
+ return xRef;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException)
@@ -340,63 +321,63 @@ sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTablesInSelect( ) throw(SQLExceptio
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getExportedKeys(
const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
{
- BEGIN_TRANS
+
ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
Reference< XResultSet > xRef = pResult;
pResult->openExportedKeys(m_bUseCatalog ? catalog : Any(),schema,table);
- END_TRANS return xRef;
+ return xRef;
}
// -------------------------------------------------------------------------
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys(
const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
{
- BEGIN_TRANS
+
ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
Reference< XResultSet > xRef = pResult;
pResult->openImportedKeys(m_bUseCatalog ? catalog : Any(),schema,table);
- END_TRANS return xRef;
+ return xRef;
}
// -------------------------------------------------------------------------
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys(
const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
{
- BEGIN_TRANS
+
ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
Reference< XResultSet > xRef = pResult;
pResult->openPrimaryKeys(m_bUseCatalog ? catalog : Any(),schema,table);
- END_TRANS return xRef;
+ 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)
{
- BEGIN_TRANS
+
ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
Reference< XResultSet > xRef = pResult;
pResult->openIndexInfo(m_bUseCatalog ? catalog : Any(),schema,table,unique,approximate);
- END_TRANS return xRef;
+ 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)
{
- BEGIN_TRANS
+
ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
Reference< XResultSet > xRef = pResult;
pResult->openBestRowIdentifier(m_bUseCatalog ? catalog : Any(),schema,table,scope,nullable);
- END_TRANS return xRef;
+ return xRef;
}
// -------------------------------------------------------------------------
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) throw(SQLException, RuntimeException)
{
- BEGIN_TRANS
+
ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
Reference< XResultSet > xRef = pResult;
pResult->openTablePrivileges(m_bUseCatalog ? catalog : Any(),schemaPattern,tableNamePattern);
- END_TRANS return xRef;
+ return xRef;
}
// -------------------------------------------------------------------------
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCrossReference(
@@ -404,12 +385,12 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCrossReference(
const ::rtl::OUString& primaryTable, const Any& foreignCatalog,
const ::rtl::OUString& foreignSchema, const ::rtl::OUString& foreignTable ) throw(SQLException, RuntimeException)
{
- BEGIN_TRANS
+
ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
Reference< XResultSet > xRef = pResult;
pResult->openForeignKeys(m_bUseCatalog ? primaryCatalog : Any(),primarySchema.toChar() == '%' ? &primarySchema : NULL,&primaryTable,
m_bUseCatalog ? foreignCatalog : Any(), foreignSchema.toChar() == '%' ? &foreignSchema : NULL,&foreignTable);
- END_TRANS return xRef;
+ return xRef;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::doesMaxRowSizeIncludeBlobs( ) throw(SQLException, RuntimeException)
@@ -678,7 +659,7 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsOuterJoins( ) throw(SQLException,
// -------------------------------------------------------------------------
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes( ) throw(SQLException, RuntimeException)
{
- BEGIN_TRANS
+
// there exists no possibility to get table types so we have to check
static ::rtl::OUString sTableTypes[] =
{
@@ -709,7 +690,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes( ) throw(SQLE
aRows.push_back(aRow);
}
pResult->setRows(aRows);
- END_TRANS return xRef;
+ return xRef;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatements( ) throw(SQLException, RuntimeException)
diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
index 7c2d52eb600a..d3b2c3ccd198 100644
--- a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ODatabaseMetaDataResultSet.cxx,v $
*
- * $Revision: 1.24 $
+ * $Revision: 1.25 $
*
- * last change: $Author: hr $ $Date: 2001-10-17 14:55:06 $
+ * last change: $Author: oj $ $Date: 2001-10-22 11:17:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -994,8 +994,8 @@ void ODatabaseMetaDataResultSet::openCatalogs() throw(SQLException, RuntimeExcep
m_bFreeHandle = sal_True;
SQLRETURN nRetcode = N3SQLTables(m_aStatementHandle,
(SDB_ODBC_CHAR *) SQL_ALL_CATALOGS,SQL_NTS,
- 0,0,
- 0,0,
+ (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);
@@ -1011,9 +1011,9 @@ void ODatabaseMetaDataResultSet::openSchemas() throw(SQLException, RuntimeExcept
{
m_bFreeHandle = sal_True;
SQLRETURN nRetcode = N3SQLTables(m_aStatementHandle,
- 0,0,
+ (SDB_ODBC_CHAR *) "",SQL_NTS,
(SDB_ODBC_CHAR *) SQL_ALL_SCHEMAS,SQL_NTS,
- 0,0,
+ (SDB_ODBC_CHAR *) "",SQL_NTS,
(SDB_ODBC_CHAR *) "",SQL_NTS);
OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);