Kaydet (Commit) 4946c62f authored tarafından Frank Schoenheit [fs]'s avatar Frank Schoenheit [fs]

mysqlconnector: initial import from CWS mysqlnative

üst d9aef5ad
mc mysqlc : solenv MYSQLCPPCONN:mysqlcppconn offuh cppu soltools cppuhelper readlicense_oo NULL
ch mysqlc usr1 - all mc_mkout NULL
mc mysqlc\source nmake - all mc_source NULL
# Extensions
..\%__SRC%\bin\*.oxt %_DEST%\bin%_EXT%\*.oxt
<?xml version="1.0" encoding="UTF-8"?>
<oor:node xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="DataAccess" oor:package="org.openoffice.Office">
<node oor:name="UserDefinedDriverSettings">
<node oor:name="org.openoffice.comp.connectivity.mysql_native.Driver" oor:op="replace">
<prop oor:name="DriverName">
<value>org.openoffice.comp.connectivity.mysql_native.Driver</value>
</prop>
<prop oor:name="DriverPageDisplayName">
<value>MySQL native driver</value>
</prop>
<prop oor:name="DriverTypeDisplayName">
<value>MySQL native driver</value>
</prop>
<prop oor:name="DriverDsnPrefix">
<value>sdbc:mysqlc:</value>
</prop>
</node>
</node>
</oor:node>
---------- Status -------------------------------------------------------------
The code is on a PREVIEW level. PREVIEW means pre-alpha.
---------- Requirements -------------------------------------------------------
The MySQL driver for OpenOffice.org (MySQL Connector/OpenOffice.org - C/OOo)
requires two external libraries to be build:
1) The MySQL Client Library (libmysql)
2) The MySQL Connector/C++ Library (libmysqlcppcon)
At the time of writing neither of the two libraries are part of the CWS!
Before you can build the MySQL driver for OpenOffice.org you must install
the two required libraries on your system before you can compile the driver.
You need the two libraries because the MySQL driver for OpenOffice.org
does not feature an implementation of the MySQL Client Server
communication protocol. The protocol implementation is part of the MySQL
Client Library. And the SDBC(X) style OpenOffice.org driver is implemented as a
wrapper of the MySQL Connector/C++ Library which implements a JDBC interface and
in turn uses the C based MySQL Client Library.
1) MySQL Client Library (libmysql)
The MySQL Client Library (libmysql) is part of the MySQL Server. You need to
download and install the MySQL Server. Use a binary distribution of
MySQL 5.0.x or MySQL 5.1.x. Check the MySQL manual for instructions, e.g.
for Unix:
http://dev.mysql.com/doc/refman/5.1/en/installing-binary.html
The typical installation path of the libmysql.so on Unix is
/usr/local/mysql/lib/mysql/ .
2) MySQL Connector/C++ (libmysqlcppcon)
Download and install the latest version of the MySQL Connector/C++, see
http://forge.mysql.com/wiki/Connector_C++ . Check out the source
from the bzr repository.
3) Tweaking library paths
At the time of writing you might have to *manually* tweak library paths and
library names by patching makefile.mk. This is a temporary hack. The makefile
will be improved later.
However, for the moment check the makefile.mk if the compilation fails due to
"missing" libraries (= libraries not found). For example, check the following
settings:
MYSQL_INCDIR=/usr/local/include
MYSQL_LIBDIR=/usr/local/lib
[...]
MYSQL_INCDIR=/usr/local/include
MYSQL_LIBDIR=/usr/local/lib
[...]
MYSQL_INC=-I$(MYSQL_INCDIR)
MYSQL_LIB=-L$(MYSQL_LIBDIR) -lmysqlclient -rdynamic -lz -lcrypt -lnsl -lm
MYSQL_LIBFILE=$(MYSQL_LIBDIR)$/libmysqlclient.so.16
MYSQL_CPPCONN_LIBFILE=$(MYSQL_LIBDIR)$/libmysqlcppconn.so
[...]
A common issue is libmysqlclient.so.15 vs. libmysqlclient.so.16 .
<?xml version="1.0" encoding="UTF-8"?>
<description xmlns="http://openoffice.org/extensions/description/2006" xmlns:d="http://openoffice.org/extensions/description/2006"
xmlns:xlink="http://www.w3.org/1999/xlink">
<identifier value="UPDATED_IDENTIFIER"/>
<version value="#VERSION#" />
<platform value="UPDATED_SUPPORTED_PLATFORM" />
<registration>
<simple-license accept-by="admin" default-license-id="lic-en-US" >
<license-text xlink:href="licensefile" lang="isocode" license-id="lic-isocode"/>
</simple-license>
</registration>
<display-name>
<name lang="en-US">#TITLE#</name>
</display-name>
<dependencies>
<OpenOffice.org-minimal-version value="3.1" d:name="OpenOffice.org 3.1"/>
</dependencies>
<publisher>
<name xlink:href="http://www.sun.com/software/star/staroffice/extensions.jsp?cid=925095" lang="en">Sun Microsystems</name>
</publisher>
<icon>
<default xlink:href="images/sun_extension.png" />
<high-contrast xlink:href="images/sun_extension_hc.png" />
</icon>
<extension-description>
<src lang="#LANG#" xlink:href="description/description_#LANG#.txt"/>
</extension-description>
</description>
Verbindet OpenOffice.org direkt mit MySQL-Servern
\ No newline at end of file
Connects OpenOffice.org directly with MySQL Servers
Conecta OpenOffice.org directamente con los servidores de MySQL
\ No newline at end of file
Connexion directe d'OpenOffice.org avec les serveurs MySQL.
\ No newline at end of file
Közvetlen kapcsolatot teremt az OpenOffice.org és a MySQL-kiszolgálók között.
\ No newline at end of file
Consente la connessione diretta tra OpenOffice.org e i server MySQL
\ No newline at end of file
OpenOffice.org を MySQL サーバーと直接に接続させる
\ No newline at end of file
MySQL 서버를 통해 OpenOffice.org에 직접 연결합니다.
\ No newline at end of file
Verbindt OpenOffice.org direct met MySQL Servers
\ No newline at end of file
Laczy witryne OpenOffice.org bezposrednio z systemem MySQL Servers
\ No newline at end of file
Conecta o OpenOffice.org diretamente aos servidores MySQL
\ No newline at end of file
Liga o OpenOffice.org directamente aos servidores MySQL
\ No newline at end of file
Подключает OpenOffice.org напрямую к серверам MySQL
Ansluter OpenOffice.org direkt till MySQL-servrarna
\ No newline at end of file
将 OpenOffice.org 与 MySQL 服务器直接相连
\ No newline at end of file
將 OpenOffice.org 直接連線至 MySQL 伺服器
\ No newline at end of file
component_getImplementationEnvironment
component_writeInfo
component_getFactory
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd">
<manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest">
<manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-component;type=native"
manifest:full-path="mysqlc.unoSHARED_EXTENSION"/>
<manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
manifest:full-path="registry/data/org/openoffice/Office/DataAccess/Drivers.xcu"/>
</manifest:manifest>
UDK_3_0_0 {
global:
component_getImplementationEnvironment;
component_writeInfo;
component_getFactory;
local:
*;
};
<?xml version='1.0' encoding="UTF-8"?>
<!DOCTYPE COMPONENTDESCRIPTION PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd">
<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
<module-name>mysqlc</module-name>
<component-description>
<Author>Georg Richter</Author>
<Name>com.sun.star.comp.sdbc.mysqlc</Name>
<Description>
This is the implementation of the MySQL Connector/OO.org.
</Description>
<loader-name>com.sun.star.loader.SharedLibrary</loader-name>
<language>c++</language>
<status value="final"/>
<supported-service> com.sun.star.sdbc.Driver </supported-service>
<service-dependency> ... </service-dependency>
</component-description>
<project-build-dependency> cppuhelper </project-build-dependency>
<project-build-dependency> cppu </project-build-dependency>
<project-build-dependency> sal </project-build-dependency>
<project-build-dependency> vos </project-build-dependency>
<runtime-module-dependency> cppuhelper </runtime-module-dependency>
<runtime-module-dependency> cppu1 </runtime-module-dependency>
<runtime-module-dependency> sal1 </runtime-module-dependency>
<runtime-module-dependency> vos </runtime-module-dependency>
<type> com.sun.star.registry.XRegistryKey </type>
<type> com.sun.star.util.XCancellable </type>
<type> com.sun.star.util.XNumberFormatter </type>
<type> com.sun.star.uno.TypeClass </type>
<type> com.sun.star.uno.XWeak </type>
<type> com.sun.star.uno.XAggregation </type>
<type> com.sun.star.uno.XComponentContext </type>
<type> com.sun.star.beans.PropertyAttribute </type>
<type> com.sun.star.beans.XPropertyState </type>
<type> com.sun.star.beans.XPropertySet </type>
<type> com.sun.star.beans.PropertyValue </type>
<type> com.sun.star.beans.XMultiPropertySet </type>
<type> com.sun.star.beans.XFastPropertySet </type>
<type> com.sun.star.lang.XSingleServiceFactory </type>
<type> com.sun.star.lang.XTypeProvider </type>
<type> com.sun.star.lang.XSingleComponentFactory </type>
<type> com.sun.star.lang.EventObject </type>
<type> com.sun.star.lang.XComponent </type>
<type> com.sun.star.lang.IllegalArgumentException </type>
<type> com.sun.star.lang.DisposedException </type>
<type> com.sun.star.lang.XMultiServiceFactory </type>
<type> com.sun.star.lang.XServiceInfo </type>
<type> com.sun.star.lang.XUnoTunnel </type>
<type> com.sun.star.java.XJavaThreadRegister_11 </type>
<type> com.sun.star.java.XJavaVM </type>
<type> com.sun.star.sdbc.FetchDirection </type>
<type> com.sun.star.sdbc.XConnection </type>
<type> com.sun.star.sdbc.XStatement </type>
<type> com.sun.star.sdbc.XResultSet </type>
<type> com.sun.star.sdbc.XResultSetMetaDataSupplier</type>
<type> com.sun.star.sdbc.XColumnLocate </type>
<type> com.sun.star.sdbc.XResultSetUpdate </type>
<type> com.sun.star.sdbc.XWarningsSupplier </type>
<type> com.sun.star.sdbc.XRowUpdate </type>
<type> com.sun.star.sdbc.XMultipleResults </type>
<type> com.sun.star.sdbc.XBatchExecution </type>
<type> com.sun.star.sdbc.XPreparedBatchExecution </type>
<type> com.sun.star.sdbc.XParameters </type>
<type> com.sun.star.sdbc.XOutParameters </type>
<type> com.sun.star.sdbc.DriverPropertyInfo </type>
<type> com.sun.star.sdbc.SQLWarning </type>
<type> com.sun.star.sdbc.XRow </type>
<type> com.sun.star.sdbc.ColumnSearch </type>
<type> com.sun.star.sdbc.ColumnValue </type>
<type> com.sun.star.sdbc.DataType </type>
<type> com.sun.star.sdbc.XDriver </type>
<type> com.sun.star.sdbc.TransactionIsolation </type>
<type> com.sun.star.sdbc.ResultSetType </type>
<type> com.sun.star.sdbc.ResultSetConcurrency </type>
<type> com.sun.star.sdbcx.XRowLocate </type>
<type> com.sun.star.sdbcx.XDeleteRows </type>
<type> com.sun.star.sdbcx.CompareBookmark </type>
<type> com.sun.star.sdb.XColumnUpdate </type>
<type> com.sun.star.sdb.XColumn </type>
</module-description>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*************************************************************************
* 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
*
* $RCSfile: mysqlc_driver.hxx,v $
*
* $Revision: 1.1.2.4 $
*
* 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.
************************************************************************/
#ifndef MYSQLC_SDRIVER_HXX
#define MYSQLC_SDRIVER_HXX
#include "mysqlc_connection.hxx"
#include <com/sun/star/sdbc/XDriver.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/compbase2.hxx>
#include <cppconn/driver.h>
#include <osl/module.h>
namespace connectivity
{
namespace mysqlc
{
using ::rtl::OUString;
using ::com::sun::star::sdbc::SQLException;
using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
Reference< ::com::sun::star::uno::XInterface > SAL_CALL MysqlCDriver_CreateInstance(const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw(Exception);
typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::sdbc::XDriver,
::com::sun::star::lang::XServiceInfo > ODriver_BASE;
typedef void* (SAL_CALL * OMysqlCConnection_CreateInstanceFunction)(void* _pDriver);
class MysqlCDriver : public ODriver_BASE
{
protected:
Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
::osl::Mutex m_aMutex; // mutex is need to control member access
OWeakRefArray m_xConnections; // vector containing a list
// of all the Connection objects
// for this Driver
#ifndef SYSTEM_MYSQL_CPPCONN
oslModule m_hCppConnModule;
bool m_bAttemptedLoadCppConn;
#endif
sql::Driver * cppDriver;
public:
MysqlCDriver(const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
// OComponentHelper
void SAL_CALL disposing(void);
// XInterface
static OUString getImplementationName_Static() throw(RuntimeException);
static Sequence< OUString > getSupportedServiceNames_Static() throw(RuntimeException);
// XServiceInfo
OUString SAL_CALL getImplementationName() throw(RuntimeException);
sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw(RuntimeException);
Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(RuntimeException);
// XDriver
Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect(const OUString& url, const Sequence< ::com::sun::star::beans::PropertyValue >& info)
throw(SQLException, RuntimeException);
sal_Bool SAL_CALL acceptsURL(const OUString& url) throw(SQLException, RuntimeException);
Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo(const OUString& url, const Sequence< ::com::sun::star::beans::PropertyValue >& info)
throw(SQLException, RuntimeException);
sal_Int32 SAL_CALL getMajorVersion() throw(RuntimeException);
sal_Int32 SAL_CALL getMinorVersion() throw(RuntimeException);
inline Reference< ::com::sun::star::lang::XMultiServiceFactory > getFactory() const { return m_xFactory; }
rtl_TextEncoding getDefaultEncoding() { return RTL_TEXTENCODING_UTF8; }
private:
void impl_initCppConn_lck_throw();
};
} /* mysqlc */
} /* connectivity */
#endif // MYSQLC_SDRIVER_HXX
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/
/*************************************************************************
* 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
*
* $RCSfile: mysqlc_general.cxx,v $
*
* $Revision: 1.1.2.3 $
*
* 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.
************************************************************************/
#include "mysqlc_general.hxx"
#include "mysqlc_resultsetmetadata.hxx"
#include <cppconn/exception.h>
#include <cppconn/datatype.h>
using com::sun::star::sdbc::SQLException;
using com::sun::star::uno::UNO_QUERY;
using com::sun::star::uno::Reference;
using com::sun::star::uno::XInterface;
using com::sun::star::uno::Any;
using ::rtl::OUString;
namespace mysqlc_sdbc_driver
{
// -----------------------------------------------------------------------------
void throwFeatureNotImplementedException( const sal_Char* _pAsciiFeatureName, const Reference< XInterface >& _rxContext, const Any* _pNextException )
throw (SQLException)
{
const ::rtl::OUString sMessage = ::rtl::OUString::createFromAscii( _pAsciiFeatureName ) + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ": feature not implemented." ) );
throw SQLException(
sMessage,
_rxContext,
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HYC00")),
0,
_pNextException ? *_pNextException : Any()
);
}
void throwInvalidArgumentException( const sal_Char* _pAsciiFeatureName, const Reference< XInterface >& _rxContext, const Any* _pNextException )
throw (SQLException)
{
const ::rtl::OUString sMessage = ::rtl::OUString::createFromAscii( _pAsciiFeatureName ) + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ": invalid arguments." ) );
throw SQLException(
sMessage,
_rxContext,
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HYC00")),
0,
_pNextException ? *_pNextException : Any()
);
}
void translateAndThrow(const ::sql::SQLException& _error, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _context, const rtl_TextEncoding encoding)
{
throw SQLException(
convert(_error.what(), encoding),
_context,
convert(_error.getSQLState(), encoding),
_error.getErrorCode(),
Any()
);
}
OUString getStringFromAny(const Any& _rAny)
{
OUString nReturn;
OSL_VERIFY( _rAny >>= nReturn );
return nReturn;
}
int mysqlToOOOType(int cppConnType)
throw ()
{
switch (cppConnType) {
case sql::DataType::BIT:
return com::sun::star::sdbc::DataType::VARCHAR;
case sql::DataType::TINYINT:
return com::sun::star::sdbc::DataType::TINYINT;
case sql::DataType::SMALLINT:
return com::sun::star::sdbc::DataType::SMALLINT;
case sql::DataType::INTEGER:
return com::sun::star::sdbc::DataType::INTEGER;
case sql::DataType::BIGINT:
return com::sun::star::sdbc::DataType::BIGINT;
case sql::DataType::REAL:
return com::sun::star::sdbc::DataType::REAL;
case sql::DataType::DOUBLE:
return com::sun::star::sdbc::DataType::DOUBLE;
case sql::DataType::DECIMAL:
return com::sun::star::sdbc::DataType::DECIMAL;
case sql::DataType::CHAR:
return com::sun::star::sdbc::DataType::CHAR;
case sql::DataType::BINARY:
return com::sun::star::sdbc::DataType::BINARY;
case sql::DataType::ENUM:
case sql::DataType::SET:
case sql::DataType::VARCHAR:
return com::sun::star::sdbc::DataType::VARCHAR;
case sql::DataType::VARBINARY:
return com::sun::star::sdbc::DataType::VARBINARY;
case sql::DataType::LONGVARCHAR:
return com::sun::star::sdbc::DataType::LONGVARCHAR;
case sql::DataType::LONGVARBINARY:
return com::sun::star::sdbc::DataType::LONGVARBINARY;
case sql::DataType::TIMESTAMP:
return com::sun::star::sdbc::DataType::TIMESTAMP;
case sql::DataType::DATE:
return com::sun::star::sdbc::DataType::DATE;
case sql::DataType::TIME:
return com::sun::star::sdbc::DataType::TIME;
case sql::DataType::GEOMETRY:
return com::sun::star::sdbc::DataType::VARCHAR;
case sql::DataType::SQLNULL:
return com::sun::star::sdbc::DataType::SQLNULL;
case sql::DataType::UNKNOWN:
return com::sun::star::sdbc::DataType::VARCHAR;
}
OSL_ENSURE( false, "mysqlToOOOType: unhandled case, falling back to VARCHAR" );
return com::sun::star::sdbc::DataType::VARCHAR;
}
::rtl::OUString convert(const ::std::string& _string, const rtl_TextEncoding encoding)
{
return ::rtl::OUString( _string.c_str(), _string.size(), encoding );
}
::std::string convert(const ::rtl::OUString& _string, const rtl_TextEncoding encoding)
{
return ::std::string( ::rtl::OUStringToOString( _string, encoding ).getStr() );
}
} /* namespace */
/*************************************************************************
* 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
*
* $RCSfile: mysqlc_general.hxx,v $
*
* $Revision: 1.1.2.3 $
*
* 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.
************************************************************************/
#ifndef _MYSQLC_GENERAL_
#define _MYSQLC_GENERAL_
#include <cppconn/exception.h>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/sdbc/SQLException.hpp>
namespace mysqlc_sdbc_driver
{
rtl::OUString getStringFromAny(const ::com::sun::star::uno::Any& _rAny);
void throwFeatureNotImplementedException(
const sal_Char* _pAsciiFeatureName,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext,
const ::com::sun::star::uno::Any* _pNextException = NULL
)
throw (::com::sun::star::sdbc::SQLException);
void throwInvalidArgumentException(
const sal_Char* _pAsciiFeatureName,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext,
const ::com::sun::star::uno::Any* _pNextException = NULL
)
throw (::com::sun::star::sdbc::SQLException);
void translateAndThrow(const ::sql::SQLException& _error, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _context, const rtl_TextEncoding encoding);
int mysqlToOOOType(int mysqlType) throw ();
::rtl::OUString convert(const ::std::string& _string, const rtl_TextEncoding encoding);
::std::string convert(const ::rtl::OUString& _string, const rtl_TextEncoding encoding);
}
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_
#define _CONNECTIVITY_PROPERTYIDS_HXX_
// this define has to be set to split the names into different dll's or so's
// every dll has his own set of property names
#ifndef _RTL_USTRING_
#include <rtl/ustring.hxx>
#endif
#ifndef _MAP_
#include <map>
#endif
namespace connectivity
{
namespace mysqlc
{
class OPropertyMap
{
::std::map<sal_Int32 , rtl_uString*> m_aPropertyMap;
::rtl::OUString fillValue(sal_Int32 _nIndex);
public:
OPropertyMap()
{
}
~OPropertyMap();
::rtl::OUString getNameByIndex(sal_Int32 _nIndex) const;
static OPropertyMap& getPropMap()
{
static OPropertyMap s_aPropMap;
return s_aPropMap;
}
};
typedef const sal_Char* (*PVFN)();
struct UStringDescription
{
const sal_Char* pZeroTerminatedName;
sal_Int32 nLength;
UStringDescription(PVFN _fCharFkt);
operator ::rtl::OUString() const { return ::rtl::OUString(pZeroTerminatedName,nLength,RTL_TEXTENCODING_ASCII_US); }
~UStringDescription();
private:
UStringDescription();
};
enum
{
PROPERTY_ID_FIRST = 0,
PROPERTY_ID_QUERYTIMEOUT,
PROPERTY_ID_MAXFIELDSIZE,
PROPERTY_ID_MAXROWS,
PROPERTY_ID_CURSORNAME,
PROPERTY_ID_RESULTSETCONCURRENCY,
PROPERTY_ID_RESULTSETTYPE,
PROPERTY_ID_FETCHDIRECTION,
PROPERTY_ID_FETCHSIZE,
PROPERTY_ID_ESCAPEPROCESSING,
PROPERTY_ID_USEBOOKMARKS,
// Column
PROPERTY_ID_NAME,
PROPERTY_ID_TYPE,
PROPERTY_ID_TYPENAME,
PROPERTY_ID_PRECISION,
PROPERTY_ID_SCALE,
PROPERTY_ID_ISNULLABLE,
PROPERTY_ID_ISAUTOINCREMENT,
PROPERTY_ID_ISROWVERSION,
PROPERTY_ID_DESCRIPTION,
PROPERTY_ID_DEFAULTVALUE,
PROPERTY_ID_REFERENCEDTABLE,
PROPERTY_ID_UPDATERULE,
PROPERTY_ID_DELETERULE,
PROPERTY_ID_CATALOG,
PROPERTY_ID_ISUNIQUE,
PROPERTY_ID_ISPRIMARYKEYINDEX,
PROPERTY_ID_ISCLUSTERED,
PROPERTY_ID_ISASCENDING,
PROPERTY_ID_SCHEMANAME,
PROPERTY_ID_CATALOGNAME,
PROPERTY_ID_COMMAND,
PROPERTY_ID_CHECKOPTION,
PROPERTY_ID_PASSWORD,
PROPERTY_ID_RELATEDCOLUMN,
PROPERTY_ID_FUNCTION,
PROPERTY_ID_TABLENAME,
PROPERTY_ID_REALNAME,
PROPERTY_ID_DBASEPRECISIONCHANGED,
PROPERTY_ID_ISCURRENCY,
PROPERTY_ID_ISBOOKMARKABLE,
PROPERTY_ID_INVALID_INDEX,
PROPERTY_ID_ERRORMSG_SEQUENCE,
PROPERTY_ID_HY010,
PROPERTY_ID_HY0000,
PROPERTY_ID_DELIMITER,
PROPERTY_ID_FORMATKEY,
PROPERTY_ID_LOCALE,
PROPERTY_ID_IM001,
PROPERTY_ID_AUTOINCREMENTCREATION,
PROPERTY_ID_PRIVILEGES,
PROPERTY_ID_LAST
};
}/* mysqlc */
}/* connectivity */
//------------------------------------------------------------------------------
#define DECL_PROP1IMPL(varname, type) \
pProperties[nPos++] = Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_##varname), PROPERTY_ID_##varname, ::getCppuType(reinterpret_cast< type*>(NULL)),
//------------------------------------------------------------------------------
#define DECL_PROP0(varname, type) \
DECL_PROP1IMPL(varname, type) 0)
//------------------------------------------------------------------------------
#define DECL_BOOL_PROP1IMPL(varname) \
pProperties[nPos++] = Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_##varname), PROPERTY_ID_##varname, ::getBooleanCppuType(),
//------------------------------------------------------------------------------
#define DECL_BOOL_PROP0(varname) \
DECL_BOOL_PROP1IMPL(varname) 0)
#endif // _CONNECTIVITY_PROPERTYIDS_HXX_
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#*************************************************************************
#
# 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.
#
#*************************************************************************
MYSQLC_VERSION_MAJOR=1
MYSQLC_VERSION_MINOR=0
MYSQLC_VERSION_MICRO=0
# the title, as displayed in the Extension Manager
MYSQLC_TITLE=MySQL Connector for OpenOffice.org
# the status of the extension
# if this is different from "final", it will be appended to the title displayed in the Extension Manager
# and also added to the file name of the resulting .oxt file
MYSQLC_STATUS=final
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