Tag: cws_src680_qiq
User: fs      
Date: 2006/07/03 12:48:50

Modified:
   dba/dbaccess/source/core/api/query.cxx
   dba/dbaccess/source/core/api/querydescriptor.cxx
   dba/dbaccess/source/core/inc/core_resource.hrc
   dba/dbaccess/source/core/resource/strings.src

Log:
 #i51143# warning when trying to obtain columns for a query whose statement 
does not produce a result set

File Changes:

Directory: /dba/dbaccess/source/core/api/
=========================================

File [changed]: query.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/query.cxx?r1=1.29.124.5&r2=1.29.124.6
Delta lines:  +23 -12
---------------------
--- query.cxx   30 Jun 2006 13:27:17 -0000      1.29.124.5
+++ query.cxx   3 Jul 2006 19:48:47 -0000       1.29.124.6
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: query.cxx,v $
  *
- *  $Revision: 1.29.124.5 $
+ *  $Revision: 1.29.124.6 $
  *
- *  last change: $Author: fs $ $Date: 2006/06/30 13:27:17 $
+ *  last change: $Author: fs $ $Date: 2006/07/03 19:48:47 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -45,6 +45,12 @@
 #ifndef DBA_HELPERCOLLECTIONS_HXX
 #include "HelperCollections.hxx"
 #endif
+#ifndef _DBA_CORE_RESOURCE_HXX_
+#include "core_resource.hxx"
+#endif
+#ifndef _DBA_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
 
 #ifndef _CPPUHELPER_QUERYINTERFACE_HXX_
 #include <cppuhelper/queryinterface.hxx>
@@ -52,6 +58,9 @@
 #ifndef _TOOLS_DEBUG_HXX
 #include <tools/debug.hxx>
 #endif
+#ifndef TOOLS_DIAGNOSE_EX_H
+#include <tools/diagnose_ex.h>
+#endif
 #ifndef _COMPHELPER_PROPERTY_AGGREGATION_HXX_
 #include <comphelper/propagg.hxx>
 #endif
@@ -66,11 +75,8 @@
 #ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
 #include <com/sun/star/lang/DisposedException.hpp>
 #endif
-#ifndef _COM_SUN_STAR_SDB_XSQLQUERYCOMPOSERFACTORY_HPP_
-#include <com/sun/star/sdb/XSQLQueryComposerFactory.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDB_XSQLQUERYCOMPOSER_HPP_
-#include <com/sun/star/sdb/XSQLQueryComposer.hpp>
+#ifndef _COM_SUN_STAR_SDB_XSINGLESELECTQUERYCOMPOSER_HPP_
+#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
 #endif
 #ifndef _COM_SUN_STAR_SDBC_XRESULTSETMETADATASUPPLIER_HPP_
 #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
@@ -199,9 +205,9 @@
                }
 
                // fill the columns with columns from the statement
-               Reference< XSQLQueryComposerFactory >  xFactory( m_xConnection, 
UNO_QUERY_THROW );
-        SharedUNOComponent< XSQLQueryComposer, DisposableComponent > xComposer(
-            Reference< XSQLQueryComposer >( xFactory->createQueryComposer(), 
UNO_QUERY_THROW ) );
+               Reference< XMultiServiceFactory > xFactory( m_xConnection, 
UNO_QUERY_THROW );
+        SharedUNOComponent< XSingleSelectQueryComposer, DisposableComponent > 
xComposer(
+            Reference< XSingleSelectQueryComposer >( xFactory->createInstance( 
SERVICE_NAME_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY_THROW ) );
 
         Reference< XNameAccess > xColumns;
         try
@@ -217,7 +223,12 @@
         {   // the QueryComposer could not parse it. Try a lean version.
             xPreparedStatement.set( m_xConnection->prepareStatement( 
m_sCommand ), UNO_QUERY_THROW );
                    Reference< XResultSetMetaDataSupplier > xResMetaDataSup( 
xPreparedStatement, UNO_QUERY_THROW );
-            Reference< XResultSetMetaData > xResultSetMeta( 
xResMetaDataSup->getMetaData(), UNO_QUERY_THROW );
+            Reference< XResultSetMetaData > xResultSetMeta( 
xResMetaDataSup->getMetaData() );
+            if ( !xResultSetMeta.is() )
+            {
+                ::rtl::OUString sError( DBA_RES( 
RID_STR_STATEMENT_WITHOUT_RESULT_SET ) );
+                ::dbtools::throwSQLException( sError, SQL_GENERAL_ERROR, *this 
);
+            }
 
             Reference< XDatabaseMetaData > xDBMeta( 
m_xConnection->getMetaData(), UNO_QUERY_THROW );
             ::vos::ORef< OSQLColumns > aParseColumns(
@@ -262,7 +273,7 @@
        }
        catch( const Exception& )
        {
-               DBG_ERROR( "OQuery::rebuildColumns: caught a strange 
exception!" );
+               DBG_UNHANDLED_EXCEPTION();
        }
 }
 

File [changed]: querydescriptor.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/querydescriptor.cxx?r1=1.26.78.5&r2=1.26.78.6
Delta lines:  +11 -3
--------------------
--- querydescriptor.cxx 30 Jun 2006 13:27:18 -0000      1.26.78.5
+++ querydescriptor.cxx 3 Jul 2006 19:48:47 -0000       1.26.78.6
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: querydescriptor.cxx,v $
  *
- *  $Revision: 1.26.78.5 $
+ *  $Revision: 1.26.78.6 $
  *
- *  last change: $Author: fs $ $Date: 2006/06/30 13:27:18 $
+ *  last change: $Author: fs $ $Date: 2006/07/03 19:48:47 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -261,7 +261,15 @@
                setColumnsOutOfDate( sal_False );
 
            // rebuild them
+        try
+        {
            rebuildColumns();
+        }
+        catch(...)
+        {
+            setColumnsOutOfDate( sal_True );
+            throw;
+        }
        }
        
        return m_pColumns;

Directory: /dba/dbaccess/source/core/inc/
=========================================

File [changed]: core_resource.hrc
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/inc/core_resource.hrc?r1=1.11.124.2&r2=1.11.124.3
Delta lines:  +3 -2
-------------------
--- core_resource.hrc   9 Jun 2006 11:54:48 -0000       1.11.124.2
+++ core_resource.hrc   3 Jul 2006 19:48:47 -0000       1.11.124.3
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: core_resource.hrc,v $
  *
- *  $Revision: 1.11.124.2 $
+ *  $Revision: 1.11.124.3 $
  *
- *  last change: $Author: fs $ $Date: 2006/06/09 11:54:48 $
+ *  last change: $Author: fs $ $Date: 2006/07/03 19:48:47 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -83,6 +83,7 @@
 #define RID_STR_FILE_DOES_NOT_EXIST             ( RID_CORE_STRINGS_START + 35 )
 #define RID_STR_CONFLICTING_NAMES               ( RID_CORE_STRINGS_START + 36 )
 #define RID_STR_COMMAND_LEADING_TO_ERROR        ( RID_CORE_STRINGS_START + 37 )
+#define RID_STR_STATEMENT_WITHOUT_RESULT_SET    ( RID_CORE_STRINGS_START + 38 )
 
 #endif // _DBA_CORE_RESOURCE_HRC_
 

Directory: /dba/dbaccess/source/core/resource/
==============================================

File [changed]: strings.src
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/resource/strings.src?r1=1.48.118.3&r2=1.48.118.4
Delta lines:  +10 -4
--------------------
--- strings.src 9 Jun 2006 11:54:57 -0000       1.48.118.3
+++ strings.src 3 Jul 2006 19:48:48 -0000       1.48.118.4
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: strings.src,v $
  *
- *  $Revision: 1.48.118.3 $
+ *  $Revision: 1.48.118.4 $
  *
- *  last change: $Author: fs $ $Date: 2006/06/09 11:54:57 $
+ *  last change: $Author: fs $ $Date: 2006/07/03 19:48:48 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -235,5 +235,11 @@
     Text [ de ] = "Das SQL-Kommando, welches zu diesem Fehler führte, 
ist:\n\n$command$";
     Text [ en-US ] = "The SQL command leading to this error is:\n\n$command$";
 
-    Text [ x-comment ] = "$command is a placeholder, please preserve it.";
+    Text [ x-comment ] = "$command$ is a placeholder, please preserve it.";
+};
+
+String RID_STR_STATEMENT_WITHOUT_RESULT_SET
+{
+    Text [ de ] = "Das SQL-Kommando beschreibt keine Ergebnismenge.";
+    Text [ de ] = "The SQL command does not describe a result set.";
 };
\ No newline at end of file




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to