Kaydet (Commit) e28033fd authored tarafından Lionel Elie Mamane's avatar Lionel Elie Mamane

Apply sdbc-postgresql.diff

üst 7ce4bb76
#*************************************************************************
#
# $RCSfile: makefile.mk,v $
#
# $Revision: 1.1.2.15 $
#
# last change: $Author: jbu $ $Date: 2010/02/07 12:31:34 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
#
# - GNU Lesser General Public License Version 2.1
# - Sun Industry Standards Source License Version 1.1
#
# Sun Microsystems Inc., October, 2000
#
# GNU Lesser General Public License Version 2.1
# =============================================
# Copyright 2000 by Sun Microsystems, Inc.
# 901 San Antonio Road, Palo Alto, CA 94303, USA
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1, as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
#
# Sun Industry Standards Source License Version 1.1
# =================================================
# The contents of this file are subject to the Sun Industry Standards
# Source License Version 1.1 (the "License"); You may not use this file
# except in compliance with the License. You may obtain a copy of the
# License at http://www.openoffice.org/license.html.
#
# Software provided under this License is provided on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
# See the License for the specific provisions governing your rights and
# obligations concerning the Software.
#
# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
#
# Copyright: 2000 by Sun Microsystems, Inc.
#
# All Rights Reserved.
#
# Contributor(s): _______________________________________
#
#
#
#*************************************************************************
PRJ=..$/..$/..
PRJNAME=postgresql
TARGET=postgresql
ENABLE_EXCEPTIONS=TRUE
LIBTARGET=NO
USE_DEFFILE=TRUE
NO_DEFAULT_STL=TRUE
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
.IF "$(SYSTEM_POSTGRESQL)" != "YES"
.INCLUDE : $(SOLARINCDIR)$/postgresql/postgresql-version.mk
.ENDIF
#-------------------------------------------------------------------
# uno component naming scheme
DLLPRE=
PQ_SDBC_MAJOR=0
PQ_SDBC_MINOR=7
PQ_SDBC_MICRO=6b
.IF "$(SYSTEM_POSTGRESQL)" == "YES"
POSTGRESQL_MAJOR=`pg_config --version | awk '{ print $$2 }' | cut -d. -f1`
POSTGRESQL_MINOR=`pg_config --version | awk '{ print $$2 }' | cut -d. -f2`
POSTGRESQL_MICRO=`pg_config --version | awk '{ print $$2 }' | cut -d. -f3`
.ENDIF
.IF "$(SYSTEM_POSTGRESQL)" != "YES"
POSTGRESQL_INCLUDES=-I$(SOLARINCDIR)$/postgresql
.ELSE
POSTGRESQL_INCLUDES=-I`pg_config --includedir`
.ENDIF
CFLAGS+=$(POSTGRESQL_INCLUDES) \
-DPOSTGRESQL_MAJOR=$(POSTGRESQL_MAJOR) \
-DPOSTGRESQL_MINOR=$(POSTGRESQL_MINOR) \
-DPOSTGRESQL_MICRO=$(POSTGRESQL_MICRO) \
-DPQ_SDBC_MAJOR=$(PQ_SDBC_MAJOR) \
-DPQ_SDBC_MINOR=$(PQ_SDBC_MINOR) \
-DPQ_SDBC_MICRO=$(PQ_SDBC_MICRO)
SHL1TARGET=postgresql-sdbc.uno
LIB1TARGET=$(SLB)$/$(SHL1TARGET).lib
LIB1OBJFILES= \
$(SLO)$/pq_driver.obj
SHL1STDLIBS= \
$(CPPULIB) \
$(CPPUHELPERLIB) \
$(SALLIB)
SHL1LIBS= $(LIB1TARGET)
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME= $(SHL1TARGET)
SHL1VERSIONMAP=$(SOLARENV)$/src$/component.map
# use the static version
.IF "$(GUI)"=="WNT"
PQLIB=libpq.lib wsock32.lib advapi32.lib
.ELSE
PQLIB=-lpq -lcrypt
.ENDIF
SHL2TARGET=postgresql-sdbc-impl.uno
LIB2TARGET=$(SLB)$/$(SHL2TARGET).lib
LIB2OBJFILES= \
$(SLO)$/pq_connection.obj \
$(SLO)$/pq_statement.obj \
$(SLO)$/pq_resultset.obj \
$(SLO)$/pq_preparedstatement.obj \
$(SLO)$/pq_resultsetmetadata.obj \
$(SLO)$/pq_databasemetadata.obj \
$(SLO)$/pq_sequenceresultset.obj \
$(SLO)$/pq_baseresultset.obj \
$(SLO)$/pq_statics.obj \
$(SLO)$/pq_xtable.obj \
$(SLO)$/pq_xcontainer.obj \
$(SLO)$/pq_xbase.obj \
$(SLO)$/pq_xtables.obj \
$(SLO)$/pq_xcolumns.obj \
$(SLO)$/pq_xcolumn.obj \
$(SLO)$/pq_tools.obj \
$(SLO)$/pq_xkey.obj \
$(SLO)$/pq_xkeys.obj \
$(SLO)$/pq_xkeycolumn.obj \
$(SLO)$/pq_xkeycolumns.obj \
$(SLO)$/pq_xuser.obj \
$(SLO)$/pq_xusers.obj \
$(SLO)$/pq_xview.obj \
$(SLO)$/pq_xviews.obj \
$(SLO)$/pq_xindex.obj \
$(SLO)$/pq_xindexes.obj \
$(SLO)$/pq_xindexcolumn.obj \
$(SLO)$/pq_xindexcolumns.obj \
$(SLO)$/pq_updateableresultset.obj \
$(SLO)$/pq_fakedupdateableresultset.obj \
$(SLO)$/pq_array.obj \
$(SLO)$/pq_sequenceresultsetmetadata.obj
SHL2STDLIBS= \
$(CPPULIB) \
$(CPPUHELPERLIB) \
$(SALLIB) \
$(SALHELPERLIB) \
$(PQLIB)
SHL2LIBS= $(LIB2TARGET)
SHL2DEF= $(MISC)$/$(SHL2TARGET).def
DEF2NAME= $(SHL2TARGET)
SHL2VERSIONMAP=$(SOLARENV)$/src$/component.map
SLOFILES= $(LIB1OBJFILES) $(LIB2OBJFILES)
DRIVERNAME=postgresql-sdbc-$(PQ_SDBC_MAJOR).$(PQ_SDBC_MINOR).$(PQ_SDBC_MICRO).zip
ALLTAR : $(DLLDEST)$/$(DRIVERNAME)
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
.IF "$(GUI)" == "UNX"
INI_EXT=rc
.ELSE
INI_EXT=.ini
.ENDIF
$(DLLDEST)$/$(SHL1TARGET)$(INI_EXT): $(SHL1TARGET)
+cp $? $@
$(DLLDEST)$/$(DRIVERNAME): \
$(DLLDEST)$/postgresql.xcu \
$(DLLDEST)$/$(SHL1TARGET)$(DLLPOST) \
$(DLLDEST)$/$(SHL2TARGET)$(DLLPOST) \
$(DLLDEST)$/$(SHL1TARGET)$(INI_EXT)
+cd $(DLLDEST) && \
zip -r $(DRIVERNAME) \
$(SHL1TARGET)$(DLLPOST) \
$(SHL2TARGET)$(DLLPOST) \
$(SHL1TARGET)$(INI_EXT) \
postgresql.xcu
$(DLLDEST)$/postgresql.xcu : postgresql.xcu
-rm -f $@
cat postgresql.xcu > $@
strip :
.IF "$(GUI)"!="WNT"
strip $(DLLDEST)$/$(SHL1TARGET)$(DLLPOST) $(DLLDEST)$/$(SHL2TARGET)$(DLLPOST)
.ENDIF
<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************ -->
<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<node oor:name="Installed">
<node oor:name="sdbc:postgresql:*" oor:op="replace">
<prop oor:name="Driver">
<value>org.openoffice.comp.connectivity.pq.Driver</value>
</prop>
<prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
<value xml:lang="en-US">postgresql</value>
</prop>
<node oor:name="Properties">
</node>
<node oor:name="Features">
</node>
<node oor:name="MetaData">
<node oor:name="Authentication" oor:op="replace">
<prop oor:name="Value" oor:type="xs:string">
<value>UserPassword</value>
</prop>
</node>
</node>
</node>
</node>
</oor:component-data>
/*************************************************************************
*
* $RCSfile: pq_allocator.hxx,v $
*
* $Revision: 1.1.2.3 $
*
* last change: $Author: jbu $ $Date: 2007/08/28 21:24:00 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2002 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
#ifndef _PQ_ALLOCATOR_
#define _PQ_ALLOCATOR_
#include <cstddef>
#include "sal/types.h"
/** jbu: This source has been copied from sal/inc/internal/allocator.hxx,
because it is not a public interface. Thx a lot for figuring this
out.
*/
//######################################################
// This is no general purpose STL allocator but one
// necessary to use STL for some implementation but
// avoid linking sal against the STLPort library!!!
// For more information on when and how to define a
// custom stl allocator have a look at Scott Meyers:
// "Effective STL", Nicolai M. Josuttis:
// "The C++ Standard Library - A Tutorial and Reference"
// and at http://www.josuttis.com/cppcode/allocator.html
namespace pq_sdbc_driver {
template<class T>
class Allocator
{
public:
typedef T value_type;
typedef T* pointer;
typedef const T* const_pointer;
typedef T& reference;
typedef const T& const_reference;
typedef ::std::size_t size_type;
typedef ::std::ptrdiff_t difference_type;
//-----------------------------------------
template<class U>
struct rebind
{
typedef Allocator<U> other;
};
//-----------------------------------------
pointer address (reference value) const
{
return &value;
}
//-----------------------------------------
const_pointer address (const_reference value) const
{
return &value;
}
//-----------------------------------------
Allocator() SAL_THROW(())
{}
//-----------------------------------------
template<class U>
Allocator (const Allocator<U>&) SAL_THROW(())
{}
//-----------------------------------------
Allocator(const Allocator&) SAL_THROW(())
{}
//-----------------------------------------
~Allocator() SAL_THROW(())
{}
//-----------------------------------------
size_type max_size() const SAL_THROW(())
{
return size_type(-1)/sizeof(T);
}
//-----------------------------------------
/* Normally the code for allocate should
throw a std::bad_alloc exception if the
requested memory could not be allocated:
(C++ standard 20.4.1.1):
pointer allocate (size_type n, const void* hint = 0)
{
pointer p = reinterpret_cast<pointer>(
rtl_allocateMemory(sal_uInt32(n * sizeof(T))));
if (NULL == p)
throw ::std::bad_alloc();
return p;
}
but some compilers do not compile it if exceptions
are not enabled, e.g. GCC under Linux and it is
in general not desired to compile sal with exceptions
enabled. */
pointer allocate (size_type n, const void* hint = 0)
{
return reinterpret_cast<pointer>(
rtl_allocateMemory(sal_uInt32(n * sizeof(T))));
}
//-----------------------------------------
void deallocate (pointer p, size_type n)
{
rtl_freeMemory(p);
}
//-----------------------------------------
void construct (pointer p, const T& value)
{
new ((void*)p)T(value);
}
//-----------------------------------------
void destroy (pointer p)
{
p->~T();
}
};
//######################################################
// Custom STL allocators must be stateless (see
// references above) that's why the operators below
// return always true or false
template<class T, class U>
inline bool operator== (const Allocator<T>&, const Allocator<U>&) SAL_THROW(())
{
return true;
}
template<class T, class U>
inline bool operator!= (const Allocator<T>&, const Allocator<U>&) SAL_THROW(())
{
return false;
}
} /* namespace sal */
//######################################################
/* REQUIRED BY STLPort (see stlport '_alloc.h'):
Hack for compilers that do not support member
template classes (e.g. MSVC 6) */
#if defined (_MSC_VER)
#if (_MSC_VER < 1400) // MSVC 6
namespace _STL
{
#endif
#endif
template<class T, class U>
inline pq_sdbc_driver::Allocator<U> & __stl_alloc_rebind (
pq_sdbc_driver::Allocator<T> & a, U const *)
{
return (pq_sdbc_driver::Allocator<U>&)(a);
}
#if defined (_MSC_VER)
#if (_MSC_VER < 1400) // MSVC 6
}
#endif
#endif
#endif /* INCLUDED_SAL_INTERNAL_ALLOCATOR_HXX */
#include <rtl/ustrbuf.hxx>
#include <com/sun/star/sdbc/XArray.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
#include "pq_array.hxx"
#include "pq_statics.hxx"
#include "pq_sequenceresultset.hxx"
using rtl::OUString;
using com::sun::star::sdbc::SQLException;
using com::sun::star::uno::Any;
using com::sun::star::uno::Sequence;
namespace pq_sdbc_driver
{
::rtl::OUString Array::getBaseTypeName( )
throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
return OUString( RTL_CONSTASCII_USTRINGPARAM( "varchar" ) );
}
sal_Int32 Array::getBaseType( )
throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
return com::sun::star::sdbc::DataType::VARCHAR;
}
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > Array::getArray(
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap )
throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
return m_data;
}
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > Array::getArrayAtIndex(
sal_Int32 index,
sal_Int32 count,
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap )
throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
checkRange( index, count );
return Sequence< Any > ( &m_data[index-1], count );
}
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > Array::getResultSet(
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap )
throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
return getResultSetAtIndex( 0 , m_data.getLength() , typeMap );
}
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > Array::getResultSetAtIndex(
sal_Int32 index,
sal_Int32 count,
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap )
throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
checkRange( index, count );
Sequence< Sequence< Any > > ret( count );
for( int i = 0 ; i < count ; i ++ )
{
Sequence< Any > row( 2 );
row[0] <<= (sal_Int32) ( i + index );
row[1] = m_data[i+index-1];
ret[i] = row;
}
return new SequenceResultSet(
m_refMutex, m_owner, getStatics().resultSetArrayColumnNames, ret, m_tc );
}
void Array::checkRange( sal_Int32 index, sal_Int32 count )
{
if( index >= 1 && index -1 + count <= m_data.getLength() )
return;
rtl::OUStringBuffer buf;
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Array::getArrayAtIndex(): allowed range for index + count " ) );
buf.append( m_data.getLength() );
buf.appendAscii( ", got " );
buf.append( index );
buf.appendAscii( " + " );
buf.append( count );
throw SQLException( buf.makeStringAndClear() , *this, rtl::OUString(), 1, Any());
}
}
/*************************************************************************
*
* $RCSfile: pq_array.hxx,v $
*
* $Revision: 1.1.2.1 $
*
* last change: $Author: jbu $ $Date: 2004/08/29 08:33:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Joerg Budischewski
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): Joerg Budischewski
*
*
************************************************************************/
#ifndef HEADER_PQ_ARRAY_HXX
#define HEADER_PQ_ARRAY_HXX
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/sdbc/XArray.hpp>
#include "pq_connection.hxx"
namespace pq_sdbc_driver
{
class Array : public cppu::WeakImplHelper1< com::sun::star::sdbc::XArray >
{
com::sun::star::uno::Sequence< com::sun::star::uno::Any > m_data;
com::sun::star::uno::Reference< com::sun::star::uno::XInterface > m_owner;
com::sun::star::uno::Reference< com::sun::star::script::XTypeConverter > m_tc;
rtl::Reference< RefCountedMutex > m_refMutex;
public:
Array(
const rtl::Reference< RefCountedMutex > & mutex,
const com::sun::star::uno::Sequence< com::sun::star::uno::Any > & data,
const com::sun::star::uno::Reference< com::sun::star::uno::XInterface > & owner,
const com::sun::star::uno::Reference< com::sun::star::script::XTypeConverter > &tc) :
m_refMutex( mutex ),
m_data( data ),
m_owner( owner ),
m_tc( tc )
{}
public: // XArray
// Methods
virtual ::rtl::OUString SAL_CALL getBaseTypeName( )
throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getBaseType( )
throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getArray(
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap )
throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getArrayAtIndex(
sal_Int32 index,
sal_Int32 count,
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap )
throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL
getResultSet(
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap )
throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getResultSetAtIndex(
sal_Int32 index,
sal_Int32 count,
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap )
throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
private:
void checkRange( sal_Int32 index, sal_Int32 count );
};
};
#endif
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
#include "pq_connection.hxx"
#include "pq_statics.hxx"
namespace pq_sdbc_driver
{
class SequenceResultSetMetaData :
public ::cppu::WeakImplHelper1 < com::sun::star::sdbc::XResultSetMetaData >
{
::rtl::Reference< RefCountedMutex > m_refMutex;
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > m_origin;
::rtl::OUString m_tableName;
::rtl::OUString m_schemaName;
ColumnMetaDataVector m_columnData;
sal_Int32 m_colCount;
void checkColumnIndex( sal_Int32 columnIndex )
throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
public:
SequenceResultSetMetaData(
const ::rtl::Reference< RefCountedMutex > & reMutex,
const ColumnMetaDataVector &vec,
int colCount );
public:
// Methods
virtual sal_Int32 SAL_CALL getColumnCount( ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getColumnLabel( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getColumnName( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getSchemaName( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getTableName( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getCatalogName( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getColumnTypeName( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getColumnServiceName( sal_Int32 column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
};
}
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment