LibreOffice Module connectivity (master) 1
Public Member Functions | Protected Member Functions | Static Protected Attributes | Private Member Functions | Private Attributes | List of all members
connectivity::java_sql_Connection Class Reference

#include <Connection.hxx>

Inheritance diagram for connectivity::java_sql_Connection:
[legend]
Collaboration diagram for connectivity::java_sql_Connection:
[legend]

Public Member Functions

virtual jclass getMyClass () const override
 
 DECLARE_SERVICE_INFO ()
 
 java_sql_Connection (const java_sql_Driver &_rDriver)
 
bool construct (const OUString &url, const css::uno::Sequence< css::beans::PropertyValue > &info)
 
const css::uno::Sequence< css::beans::PropertyValue > & getConnectionInfo () const
 
bool isIgnoreDriverPrivilegesEnabled () const
 
bool isIgnoreCurrencyEnabled () const
 
const css::uno::Any & getCatalogRestriction () const
 
const css::uno::Any & getSchemaRestriction () const
 
const java::sql::ConnectionLoggetLogger () const
 returns the instance used for logging events related to this connection More...
 
const jdbc::GlobalRef< jobject > & getDriverClassLoader () const
 returns the class loader which was used to load the driver class More...
 
virtual void SAL_CALL disposing () override
 
virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement () override
 
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement (const OUString &sql) override
 
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall (const OUString &sql) override
 
virtual OUString SAL_CALL nativeSQL (const OUString &sql) override
 
virtual void SAL_CALL setAutoCommit (sal_Bool autoCommit) override
 
virtual sal_Bool SAL_CALL getAutoCommit () override
 
virtual void SAL_CALL commit () override
 
virtual void SAL_CALL rollback () override
 
virtual sal_Bool SAL_CALL isClosed () override
 
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData () override
 
virtual void SAL_CALL setReadOnly (sal_Bool readOnly) override
 
virtual sal_Bool SAL_CALL isReadOnly () override
 
virtual void SAL_CALL setCatalog (const OUString &catalog) override
 
virtual OUString SAL_CALL getCatalog () override
 
virtual void SAL_CALL setTransactionIsolation (sal_Int32 level) override
 
virtual sal_Int32 SAL_CALL getTransactionIsolation () override
 
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTypeMap () override
 
virtual void SAL_CALL setTypeMap (const css::uno::Reference< css::container::XNameAccess > &typeMap) override
 
virtual void SAL_CALL close () override
 
virtual css::uno::Any SAL_CALL getWarnings () override
 
virtual void SAL_CALL clearWarnings () override
 
- Public Member Functions inherited from connectivity::OMetaConnection
 OMetaConnection ()
 
rtl_TextEncoding getTextEncoding () const
 
const OUString & getURL () const
 
void setURL (const OUString &_rsUrl)
 
void throwGenericSQLException (TranslateId pErrorResourceId, const css::uno::Reference< css::uno::XInterface > &_xContext)
 
const SharedResourcesgetResources () const
 
void setConnectionInfo (const css::uno::Sequence< css::beans::PropertyValue > &_aInfo)
 
const css::uno::Sequence< css::beans::PropertyValue > & getConnectionInfo () const
 
virtual void SAL_CALL disposing () override
 
virtual sal_Int64 SAL_CALL getSomething (const css::uno::Sequence< sal_Int8 > &aIdentifier) override
 
- Public Member Functions inherited from connectivity::java_lang_Object
 java_lang_Object (JNIEnv *pEnv, jobject myObj)
 
 java_lang_Object ()
 
virtual ~java_lang_Object () COVERITY_NOEXCEPT_FALSE
 
void saveRef (JNIEnv *pEnv, jobject myObj)
 
jobject getJavaObject () const
 
void clearObject (JNIEnv &rEnv)
 
void clearObject ()
 
OUString toString () const
 
static ::rtl::Reference< jvmaccess::VirtualMachinegetVM (const css::uno::Reference< css::uno::XComponentContext > &_rxContext=nullptr)
 
void obtainMethodId_throwSQL (JNIEnv *_pEnv, const char *_pMethodName, const char *_pSignature, jmethodID &_inout_MethodID) const
 
void obtainMethodId_throwRuntime (JNIEnv *_pEnv, const char *_pMethodName, const char *_pSignature, jmethodID &_inout_MethodID) const
 
bool callBooleanMethod (const char *_pMethodName, jmethodID &_inout_MethodID) const
 
bool callBooleanMethodWithIntArg (const char *_pMethodName, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
 
jobject callResultSetMethod (JNIEnv &_rEnv, const char *_pMethodName, jmethodID &_inout_MethodID) const
 
sal_Int32 callIntMethod_ThrowSQL (const char *_pMethodName, jmethodID &_inout_MethodID) const
 
sal_Int32 callIntMethod_ThrowRuntime (const char *_pMethodName, jmethodID &_inout_MethodID) const
 
sal_Int32 callIntMethodWithIntArg_ThrowSQL (const char *_pMethodName, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
 
sal_Int32 callIntMethodWithIntArg_ThrowRuntime (const char *_pMethodName, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
 
sal_Int32 callIntMethodWithStringArg (const char *_pMethodName, jmethodID &_inout_MethodID, const OUString &_nArgument) const
 
OUString callStringMethod (const char *_pMethodName, jmethodID &_inout_MethodID) const
 
OUString callStringMethodWithIntArg (const char *_pMethodName, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
 
void callVoidMethod_ThrowSQL (const char *_pMethodName, jmethodID &_inout_MethodID) const
 
void callVoidMethod_ThrowRuntime (const char *_pMethodName, jmethodID &_inout_MethodID) const
 
void callVoidMethodWithIntArg_ThrowSQL (const char *_pMethodName, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
 
void callVoidMethodWithIntArg_ThrowRuntime (const char *_pMethodName, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
 
void callVoidMethodWithBoolArg_ThrowSQL (const char *_pMethodName, jmethodID &_inout_MethodID, bool _nArgument) const
 
void callVoidMethodWithBoolArg_ThrowRuntime (const char *_pMethodName, jmethodID &_inout_MethodID, bool _nArgument) const
 
void callVoidMethodWithStringArg (const char *_pMethodName, jmethodID &_inout_MethodID, const OUString &_nArgument) const
 
jobject callObjectMethod (JNIEnv *pEnv, const char *_pMethodName, const char *_pSignature, jmethodID &_inout_MethodID) const
 
jobject callObjectMethodWithIntArg (JNIEnv *pEnv, const char *_pMethodName, const char *_pSignature, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
 
template<typename T >
callMethodWithIntArg (T(JNIEnv::*pCallMethod)(jobject obj, jmethodID methodID,...), const char *_pMethodName, const char *_pSignature, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
 
template<typename T >
void callVoidMethod_ThrowSQL (const char *_pMethodName, const char *_pSignature, jmethodID &_inout_MethodID, sal_Int32 _nArgument, const T &_aValue) const
 
- Public Member Functions inherited from connectivity::OAutoRetrievingBase
bool isAutoRetrievingEnabled () const
 
OUString getTransformedGeneratedStatement (const OUString &_sInsertStatement) const
 transform the statement to query for auto generated values More...
 

Protected Member Functions

virtual ~java_sql_Connection () override
 
virtual jclass getMyClass () const
 
- Protected Member Functions inherited from connectivity::OAutoRetrievingBase
 OAutoRetrievingBase ()
 
virtual ~OAutoRetrievingBase ()
 
void enableAutoRetrievingEnabled (bool _bAutoEnable)
 
void setAutoRetrievingStatement (const OUString &_sStmt)
 

Static Protected Attributes

static jclass theClass = nullptr
 
- Static Protected Attributes inherited from connectivity::java_lang_Object
static jclass theClass = nullptr
 

Private Member Functions

OUString transFormPreparedStatement (const OUString &_sSQL)
 transform named parameter into unnamed one. More...
 
void loadDriverFromProperties (const OUString &_sDriverClass, const OUString &_sDriverClassPath, const css::uno::Sequence< css::beans::NamedValue > &_rSystemProperties)
 
OUString impl_getJavaDriverClassPath_nothrow (const OUString &_sDriverClass)
 load driver class path from system configuration. More...
 

Private Attributes

css::uno::Reference< css::uno::XComponentContext > m_xContext
 
const java_sql_Driverm_pDriver
 
jobject m_pDriverobject
 
jdbc::GlobalRef< jobject > m_pDriverClassLoader
 
jclass m_Driver_theClass
 
java::sql::ConnectionLog m_aLogger
 
bool m_bIgnoreDriverPrivileges
 
bool m_bIgnoreCurrency
 
css::uno::Any m_aCatalogRestriction
 
css::uno::Any m_aSchemaRestriction
 

Additional Inherited Members

- Static Public Member Functions inherited from connectivity::OMetaConnection
::dbtools::OPropertyMapgetPropMap ()
 
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId ()
 
- Static Public Member Functions inherited from connectivity::java_lang_Object
static void ThrowSQLException (JNIEnv *pEnv, const css::uno::Reference< css::uno::XInterface > &_rContext)
 
static void ThrowLoggedSQLException (const ::comphelper::EventLogger &_rLogger, JNIEnv *pEnvironment, const css::uno::Reference< css::uno::XInterface > &_rxContext)
 
static void ThrowRuntimeException (JNIEnv *pEnv, const css::uno::Reference< css::uno::XInterface > &_rContext)
 
static jclass findMyClass (const char *_pClassName)
 
- Protected Attributes inherited from connectivity::OMetaConnection
::osl::Mutex m_aMutex
 
css::uno::Sequence< css::beans::PropertyValue > m_aConnectionInfo
 
connectivity::OWeakRefArray m_aStatements
 
OUString m_sURL
 
rtl_TextEncoding m_nTextEncoding
 
css::uno::WeakReference< css::sdbc::XDatabaseMetaData > m_xMetaData
 
SharedResources m_aResources
 
- Protected Attributes inherited from connectivity::java_lang_Object
jobject object
 

Detailed Description

Definition at line 36 of file inc/java/sql/Connection.hxx.

Constructor & Destructor Documentation

◆ ~java_sql_Connection()

java_sql_Connection::~java_sql_Connection ( )
overrideprotectedvirtual

◆ java_sql_Connection()

java_sql_Connection::java_sql_Connection ( const java_sql_Driver _rDriver)

Definition at line 249 of file JConnection.cxx.

References m_xContext.

Member Function Documentation

◆ clearWarnings()

void SAL_CALL java_sql_Connection::clearWarnings ( )
overridevirtual

◆ close()

void SAL_CALL java_sql_Connection::close ( )
overridevirtual

Definition at line 335 of file JConnection.cxx.

References dispose().

◆ commit()

void SAL_CALL java_sql_Connection::commit ( )
overridevirtual

◆ construct()

bool java_sql_Connection::construct ( const OUString &  url,
const css::uno::Sequence< css::beans::PropertyValue > &  info 
)

◆ createStatement()

Reference< XStatement > SAL_CALL java_sql_Connection::createStatement ( )
overridevirtual

◆ DECLARE_SERVICE_INFO()

connectivity::java_sql_Connection::DECLARE_SERVICE_INFO ( )

◆ disposing()

void java_sql_Connection::disposing ( )
overridevirtual

◆ getAutoCommit()

sal_Bool SAL_CALL java_sql_Connection::getAutoCommit ( )
overridevirtual

◆ getCatalog()

OUString SAL_CALL java_sql_Connection::getCatalog ( )
overridevirtual

◆ getCatalogRestriction()

const css::uno::Any & connectivity::java_sql_Connection::getCatalogRestriction ( ) const
inline

◆ getConnectionInfo()

const css::uno::Sequence< css::beans::PropertyValue > & connectivity::java_sql_Connection::getConnectionInfo ( ) const
inline

◆ getDriverClassLoader()

const jdbc::GlobalRef< jobject > & connectivity::java_sql_Connection::getDriverClassLoader ( ) const
inline

returns the class loader which was used to load the driver class

Usually used in conjunction with a ContextClassLoaderScope instance.

Definition at line 103 of file inc/java/sql/Connection.hxx.

References m_pDriverClassLoader.

Referenced by construct().

◆ getLogger()

const java::sql::ConnectionLog & connectivity::java_sql_Connection::getLogger ( ) const
inline

returns the instance used for logging events related to this connection

Definition at line 97 of file inc/java/sql/Connection.hxx.

References m_aLogger.

Referenced by construct(), and loadDriverFromProperties().

◆ getMetaData()

Reference< XDatabaseMetaData > SAL_CALL java_sql_Connection::getMetaData ( )
overridevirtual

◆ getMyClass()

jclass java_sql_Connection::getMyClass ( ) const
overridevirtual

Reimplemented from connectivity::java_lang_Object.

Definition at line 295 of file JConnection.cxx.

References connectivity::java_lang_Object::findMyClass(), and theClass.

◆ getSchemaRestriction()

const css::uno::Any & connectivity::java_sql_Connection::getSchemaRestriction ( ) const
inline

◆ getTransactionIsolation()

sal_Int32 SAL_CALL java_sql_Connection::getTransactionIsolation ( )
overridevirtual

◆ getTypeMap()

Reference< css::container::XNameAccess > SAL_CALL java_sql_Connection::getTypeMap ( )
overridevirtual

◆ getWarnings()

Any SAL_CALL java_sql_Connection::getWarnings ( )
overridevirtual

◆ impl_getJavaDriverClassPath_nothrow()

OUString java_sql_Connection::impl_getJavaDriverClassPath_nothrow ( const OUString &  _sDriverClass)
private

◆ isClosed()

sal_Bool SAL_CALL java_sql_Connection::isClosed ( )
overridevirtual

◆ isIgnoreCurrencyEnabled()

bool connectivity::java_sql_Connection::isIgnoreCurrencyEnabled ( ) const
inline

◆ isIgnoreDriverPrivilegesEnabled()

bool connectivity::java_sql_Connection::isIgnoreDriverPrivilegesEnabled ( ) const
inline

◆ isReadOnly()

sal_Bool SAL_CALL java_sql_Connection::isReadOnly ( )
overridevirtual

◆ loadDriverFromProperties()

void java_sql_Connection::loadDriverFromProperties ( const OUString &  _sDriverClass,
const OUString &  _sDriverClassPath,
const css::uno::Sequence< css::beans::NamedValue > &  _rSystemProperties 
)
private

◆ nativeSQL()

OUString SAL_CALL java_sql_Connection::nativeSQL ( const OUString &  sql)
overridevirtual

◆ prepareCall()

Reference< XPreparedStatement > SAL_CALL java_sql_Connection::prepareCall ( const OUString &  sql)
overridevirtual

◆ prepareStatement()

Reference< XPreparedStatement > SAL_CALL java_sql_Connection::prepareStatement ( const OUString &  sql)
overridevirtual

◆ rollback()

void SAL_CALL java_sql_Connection::rollback ( )
overridevirtual

◆ setAutoCommit()

void SAL_CALL java_sql_Connection::setAutoCommit ( sal_Bool  autoCommit)
overridevirtual

◆ setCatalog()

void SAL_CALL java_sql_Connection::setCatalog ( const OUString &  catalog)
overridevirtual

◆ setReadOnly()

void SAL_CALL java_sql_Connection::setReadOnly ( sal_Bool  readOnly)
overridevirtual

◆ setTransactionIsolation()

void SAL_CALL java_sql_Connection::setTransactionIsolation ( sal_Int32  level)
overridevirtual

◆ setTypeMap()

void SAL_CALL java_sql_Connection::setTypeMap ( const css::uno::Reference< css::container::XNameAccess > &  typeMap)
overridevirtual

◆ transFormPreparedStatement()

OUString connectivity::java_sql_Connection::transFormPreparedStatement ( const OUString &  _sSQL)
private

transform named parameter into unnamed one.

Parameters
_sSQLThe SQL statement to transform.
Returns
The new statement with unnamed parameters.

Member Data Documentation

◆ m_aCatalogRestriction

css::uno::Any connectivity::java_sql_Connection::m_aCatalogRestriction
private

Definition at line 51 of file inc/java/sql/Connection.hxx.

Referenced by construct(), and getCatalogRestriction().

◆ m_aLogger

java::sql::ConnectionLog connectivity::java_sql_Connection::m_aLogger
private

◆ m_aSchemaRestriction

css::uno::Any connectivity::java_sql_Connection::m_aSchemaRestriction
private

Definition at line 52 of file inc/java/sql/Connection.hxx.

Referenced by construct(), and getSchemaRestriction().

◆ m_bIgnoreCurrency

bool connectivity::java_sql_Connection::m_bIgnoreCurrency
private

Definition at line 50 of file inc/java/sql/Connection.hxx.

Referenced by construct(), and isIgnoreCurrencyEnabled().

◆ m_bIgnoreDriverPrivileges

bool connectivity::java_sql_Connection::m_bIgnoreDriverPrivileges
private

Definition at line 49 of file inc/java/sql/Connection.hxx.

Referenced by construct(), and isIgnoreDriverPrivilegesEnabled().

◆ m_Driver_theClass

jclass connectivity::java_sql_Connection::m_Driver_theClass
private

◆ m_pDriver

const java_sql_Driver* connectivity::java_sql_Connection::m_pDriver
private

◆ m_pDriverClassLoader

jdbc::GlobalRef< jobject > connectivity::java_sql_Connection::m_pDriverClassLoader
private

Definition at line 44 of file inc/java/sql/Connection.hxx.

Referenced by getDriverClassLoader(), and loadDriverFromProperties().

◆ m_pDriverobject

jobject connectivity::java_sql_Connection::m_pDriverobject
private

◆ m_xContext

css::uno::Reference< css::uno::XComponentContext > connectivity::java_sql_Connection::m_xContext
private

Definition at line 40 of file inc/java/sql/Connection.hxx.

Referenced by construct().

◆ theClass

jclass java_sql_Connection::theClass = nullptr
staticprotected

Definition at line 74 of file inc/java/sql/Connection.hxx.

Referenced by getMyClass().


The documentation for this class was generated from the following files: