1 /*************************************************************************
3 * $RCSfile: pq_sequenceresultset.hxx,v $
7 * last change: $Author: jbu $ $Date: 2006/01/22 15:14:32 $
9 * The Contents of this file are made available subject to the terms of
10 * either of the following licenses
12 * - GNU Lesser General Public License Version 2.1
13 * - Sun Industry Standards Source License Version 1.1
15 * Sun Microsystems Inc., October, 2000
17 * GNU Lesser General Public License Version 2.1
18 * =============================================
19 * Copyright 2000 by Sun Microsystems, Inc.
20 * 901 San Antonio Road, Palo Alto, CA 94303, USA
22 * This library is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU Lesser General Public
24 * License version 2.1, as published by the Free Software Foundation.
26 * This library is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29 * Lesser General Public License for more details.
31 * You should have received a copy of the GNU Lesser General Public
32 * License along with this library; if not, write to the Free Software
33 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
37 * Sun Industry Standards Source License Version 1.1
38 * =================================================
39 * The contents of this file are subject to the Sun Industry Standards
40 * Source License Version 1.1 (the "License"); You may not use this file
41 * except in compliance with the License. You may obtain a copy of the
42 * License at http://www.openoffice.org/license.html.
44 * Software provided under this License is provided on an "AS IS" basis,
45 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
46 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
47 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
48 * See the License for the specific provisions governing your rights and
49 * obligations concerning the Software.
51 * The Initial Developer of the Original Code is: Joerg Budischewski
53 * Copyright: 2000 by Sun Microsystems, Inc.
55 * All Rights Reserved.
57 * Contributor(s): Joerg Budischewski
60 ************************************************************************/
61 #ifndef _PG_SEQUENCERESULTSET_HXX_
62 #define _PG_SEQUENCERESULTSET_HXX_
64 #include <cppuhelper/propshlp.hxx>
65 #include <cppuhelper/component.hxx>
67 #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
68 #include <com/sun/star/sdbc/XRow.hpp>
69 #include <com/sun/star/sdbc/XCloseable.hpp>
70 #include <com/sun/star/sdbc/XColumnLocate.hpp>
71 #include "pq_connection.hxx"
72 #include "pq_baseresultset.hxx"
73 #include "pq_statics.hxx"
75 namespace pq_sdbc_driver
78 // static const sal_Int32 RESULTSET_CURSOR_NAME = 0;
79 // static const sal_Int32 RESULTSET_ESCAPE_PROCESSING = 1;
80 // static const sal_Int32 RESULTSET_FETCH_DIRECTION = 2;
81 // static const sal_Int32 RESULTSET_FETCH_SIZE = 3;
82 // static const sal_Int32 RESULTSET_RESULT_SET_CONCURRENCY = 4;
83 // static const sal_Int32 RESULTSET_RESULT_SET_TYPE = 5;
85 //#define RESULTSET_SIZE 6
88 class SequenceResultSet
: public BaseResultSet
91 ::com::sun::star::uno::Sequence
< com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
> > m_data
;
93 ::com::sun::star::uno::Sequence
< ::rtl::OUString
> m_columnNames
;
94 ::com::sun::star::uno::Reference
< com::sun::star::sdbc::XResultSetMetaData
> m_meta
;
97 /** mutex should be locked before called
99 virtual void checkClosed()
100 throw ( com::sun::star::sdbc::SQLException
, com::sun::star::uno::RuntimeException
);
102 /** unchecked, acquire mutex before calling
104 virtual ::com::sun::star::uno::Any
getValue( sal_Int32 columnIndex
);
108 const ::rtl::Reference
< RefCountedMutex
> & mutex
,
109 const com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> &owner
,
110 const com::sun::star::uno::Sequence
< rtl::OUString
> &colNames
,
111 const com::sun::star::uno::Sequence
< com::sun::star::uno::Sequence
< com::sun::star::uno::Any
> > &data
,
112 const com::sun::star::uno::Reference
< com::sun::star::script::XTypeConverter
> &tc
,
113 const ColumnMetaDataVector
*pVec
= 0);
114 ~SequenceResultSet();
116 public: // XCloseable
117 virtual void SAL_CALL
close( )
118 throw (::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
120 public: // XResultSetMetaDataSupplier
121 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XResultSetMetaData
> SAL_CALL
getMetaData( )
122 throw (::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
124 public: // XColumnLocate
125 virtual sal_Int32 SAL_CALL
findColumn( const ::rtl::OUString
& columnName
)
126 throw (::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);