LibreOffice Module connectivity (master) 1
|
#include <Connection.hxx>
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::ConnectionLog & | getLogger () 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 SharedResources & | getResources () 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::VirtualMachine > | getVM (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 > | |
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_Driver * | m_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::OPropertyMap & | getPropMap () |
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 |
Definition at line 36 of file inc/java/sql/Connection.hxx.
|
overrideprotectedvirtual |
Definition at line 260 of file JConnection.cxx.
References connectivity::java_lang_Object::clearObject(), connectivity::java_lang_Object::getVM(), m_Driver_theClass, m_pDriverobject, connectivity::SDBThreadAttach::releaseRef(), and t.
java_sql_Connection::java_sql_Connection | ( | const java_sql_Driver & | _rDriver | ) |
Definition at line 249 of file JConnection.cxx.
References m_xContext.
|
overridevirtual |
Definition at line 506 of file JConnection.cxx.
References connectivity::java_lang_Object::callVoidMethod_ThrowSQL().
|
overridevirtual |
Definition at line 335 of file JConnection.cxx.
References dispose().
|
overridevirtual |
Definition at line 340 of file JConnection.cxx.
References connectivity::java_lang_Object::callVoidMethod_ThrowSQL().
bool java_sql_Connection::construct | ( | const OUString & | url, |
const css::uno::Sequence< css::beans::PropertyValue > & | info | ||
) |
Definition at line 714 of file JConnection.cxx.
References connectivity::SDBThreadAttach::addRef(), Any, args, connectivity::convertwchar_tToJavaString(), connectivity::createStringPropertyArray(), connectivity::OAutoRetrievingBase::enableAutoRetrievingEnabled(), getDriverClassLoader(), getLogger(), comphelper::NamedValueCollection::getOrDefault(), connectivity::java_lang_Object::getVM(), impl_getJavaDriverClassPath_nothrow(), loadDriverFromProperties(), connectivity::java::sql::ConnectionLog::log(), m_aCatalogRestriction, connectivity::OMetaConnection::m_aConnectionInfo, m_aLogger, m_aSchemaRestriction, m_bIgnoreCurrency, m_bIgnoreDriverPrivileges, m_Driver_theClass, m_pDriverobject, m_xContext, connectivity::OAutoRetrievingBase::setAutoRetrievingStatement(), STR_LOG_GOT_JDBC_CONNECTION, STR_LOG_NO_SYSTEM_CONNECTION, t, connectivity::OMetaConnection::throwGenericSQLException(), and connectivity::java_lang_Object::ThrowLoggedSQLException().
|
overridevirtual |
Definition at line 431 of file JConnection.cxx.
References connectivity::checkDisposed(), connectivity::java::sql::ConnectionLog::log(), m_aLogger, connectivity::OMetaConnection::m_aMutex, connectivity::OMetaConnection::m_aStatements, STR_LOG_CREATE_STATEMENT, STR_LOG_CREATED_STATEMENT_ID, and t.
connectivity::java_sql_Connection::DECLARE_SERVICE_INFO | ( | ) |
|
overridevirtual |
Reimplemented from connectivity::OMetaConnection.
Definition at line 280 of file JConnection.cxx.
References connectivity::java_lang_Object::callVoidMethod_ThrowSQL(), connectivity::OMetaConnection::disposing(), connectivity::java::sql::ConnectionLog::log(), m_aLogger, connectivity::OMetaConnection::m_aMutex, and STR_LOG_SHUTDOWN_CONNECTION.
|
overridevirtual |
Definition at line 374 of file JConnection.cxx.
References connectivity::java_lang_Object::callBooleanMethod().
|
overridevirtual |
Definition at line 304 of file JConnection.cxx.
References connectivity::java_lang_Object::callStringMethod(), connectivity::checkDisposed(), and connectivity::OMetaConnection::m_aMutex.
|
inline |
Definition at line 92 of file inc/java/sql/Connection.hxx.
References m_aCatalogRestriction.
Referenced by connectivity::java_sql_DatabaseMetaData::getTables().
|
inline |
Definition at line 88 of file inc/java/sql/Connection.hxx.
References connectivity::OMetaConnection::m_aConnectionInfo.
|
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().
|
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().
|
overridevirtual |
Definition at line 313 of file JConnection.cxx.
References connectivity::java_lang_Object::callObjectMethod(), connectivity::checkDisposed(), connectivity::OMetaConnection::m_aMutex, connectivity::OMetaConnection::m_xMetaData, and t.
|
overridevirtual |
Reimplemented from connectivity::java_lang_Object.
Definition at line 295 of file JConnection.cxx.
References connectivity::java_lang_Object::findMyClass(), and theClass.
|
inline |
Definition at line 93 of file inc/java/sql/Connection.hxx.
References m_aSchemaRestriction.
Referenced by connectivity::java_sql_DatabaseMetaData::getTables().
|
overridevirtual |
Definition at line 413 of file JConnection.cxx.
References connectivity::java_lang_Object::callIntMethod_ThrowSQL(), connectivity::checkDisposed(), and connectivity::OMetaConnection::m_aMutex.
|
overridevirtual |
Definition at line 392 of file JConnection.cxx.
References connectivity::java_lang_Object::callObjectMethod(), connectivity::checkDisposed(), connectivity::OMetaConnection::m_aMutex, and t.
|
overridevirtual |
Definition at line 512 of file JConnection.cxx.
References Any, connectivity::java_lang_Object::callObjectMethod(), connectivity::checkDisposed(), connectivity::OMetaConnection::m_aMutex, and t.
|
private |
load driver class path from system configuration.
_sDriverClass | The driver class name to look for in the configuration. |
Definition at line 699 of file JConnection.cxx.
References utl::OConfigurationTreeRoot::CM_READONLY, utl::OConfigurationTreeRoot::createWithComponentContext(), connectivity::java_sql_Driver::getContext(), utl::OConfigurationNode::getNodeValue(), utl::OConfigurationNode::hasByName(), utl::OConfigurationNode::isValid(), m_pDriver, utl::OConfigurationNode::openNode(), and u.
Referenced by construct().
|
overridevirtual |
Definition at line 346 of file JConnection.cxx.
References connectivity::java_lang_Object::callBooleanMethod(), and connectivity::OMetaConnection::m_aMutex.
|
inline |
Definition at line 91 of file inc/java/sql/Connection.hxx.
References m_bIgnoreCurrency.
Referenced by connectivity::java_sql_ResultSetMetaData::isCurrency().
|
inline |
Definition at line 90 of file inc/java/sql/Connection.hxx.
References m_bIgnoreDriverPrivileges.
Referenced by connectivity::java_sql_DatabaseMetaData::getTablePrivileges().
|
overridevirtual |
Definition at line 354 of file JConnection.cxx.
References connectivity::java_lang_Object::callBooleanMethod(), connectivity::checkDisposed(), and connectivity::OMetaConnection::m_aMutex.
|
private |
Definition at line 605 of file JConnection.cxx.
References Exception, connectivity::java_lang_Class::forName(), cppu::getCaughtException(), connectivity::java_sql_Driver::getContext(), getLogger(), connectivity::OMetaConnection::getResources(), connectivity::java::sql::ConnectionLog::log(), m_aLogger, m_Driver_theClass, m_pDriver, m_pDriverClassLoader, m_pDriverobject, connectivity::jdbc::LocalRef< T >::release(), connectivity::jdbc::GlobalRef< T >::reset(), connectivity::jdbc::GlobalRef< T >::set(), connectivity::jdbc::LocalRef< T >::set(), connectivity::java_lang_Throwable::st_getMyClass(), connectivity::java_sql_SQLException_BASE::st_getMyClass(), STR_LOG_CONN_SUCCESS, STR_LOG_LOADING_DRIVER, STR_LOG_NO_DRIVER_CLASS, t, dbtools::throwGenericSQLException(), and connectivity::java_lang_Object::ThrowLoggedSQLException().
Referenced by construct().
|
overridevirtual |
Definition at line 478 of file JConnection.cxx.
References aStr, connectivity::checkDisposed(), connectivity::convertwchar_tToJavaString(), connectivity::jdbc::LocalRef< T >::get(), connectivity::JavaString2String(), connectivity::java::sql::ConnectionLog::log(), m_aLogger, connectivity::OMetaConnection::m_aMutex, connectivity::java_lang_Object::obtainMethodId_throwSQL(), STR_LOG_NATIVE_SQL, t, and connectivity::java_lang_Object::ThrowLoggedSQLException().
|
overridevirtual |
Definition at line 462 of file JConnection.cxx.
References connectivity::checkDisposed(), connectivity::java::sql::ConnectionLog::log(), m_aLogger, connectivity::OMetaConnection::m_aMutex, connectivity::OMetaConnection::m_aStatements, STR_LOG_PREPARE_CALL, STR_LOG_PREPARED_CALL_ID, and t.
|
overridevirtual |
Definition at line 446 of file JConnection.cxx.
References connectivity::checkDisposed(), connectivity::java::sql::ConnectionLog::log(), m_aLogger, connectivity::OMetaConnection::m_aMutex, connectivity::OMetaConnection::m_aStatements, STR_LOG_PREPARE_STATEMENT, STR_LOG_PREPARED_STATEMENT_ID, and t.
|
overridevirtual |
Definition at line 368 of file JConnection.cxx.
References connectivity::java_lang_Object::callVoidMethod_ThrowSQL().
|
overridevirtual |
Definition at line 386 of file JConnection.cxx.
References connectivity::java_lang_Object::callVoidMethodWithBoolArg_ThrowSQL().
|
overridevirtual |
Definition at line 362 of file JConnection.cxx.
References connectivity::java_lang_Object::callVoidMethodWithStringArg().
|
overridevirtual |
Definition at line 380 of file JConnection.cxx.
References connectivity::java_lang_Object::callVoidMethodWithBoolArg_ThrowSQL().
|
overridevirtual |
Definition at line 422 of file JConnection.cxx.
References connectivity::java_lang_Object::callVoidMethodWithIntArg_ThrowSQL(), connectivity::checkDisposed(), and connectivity::OMetaConnection::m_aMutex.
|
overridevirtual |
Definition at line 404 of file JConnection.cxx.
References connectivity::checkDisposed(), connectivity::OMetaConnection::m_aMutex, and dbtools::throwFeatureNotImplementedSQLException().
|
private |
transform named parameter into unnamed one.
_sSQL | The SQL statement to transform. |
|
private |
Definition at line 51 of file inc/java/sql/Connection.hxx.
Referenced by construct(), and getCatalogRestriction().
|
private |
Definition at line 48 of file inc/java/sql/Connection.hxx.
Referenced by construct(), createStatement(), disposing(), getLogger(), loadDriverFromProperties(), nativeSQL(), prepareCall(), and prepareStatement().
|
private |
Definition at line 52 of file inc/java/sql/Connection.hxx.
Referenced by construct(), and getSchemaRestriction().
|
private |
Definition at line 50 of file inc/java/sql/Connection.hxx.
Referenced by construct(), and isIgnoreCurrencyEnabled().
|
private |
Definition at line 49 of file inc/java/sql/Connection.hxx.
Referenced by construct(), and isIgnoreDriverPrivilegesEnabled().
|
private |
Definition at line 46 of file inc/java/sql/Connection.hxx.
Referenced by construct(), loadDriverFromProperties(), and ~java_sql_Connection().
|
private |
Definition at line 41 of file inc/java/sql/Connection.hxx.
Referenced by impl_getJavaDriverClassPath_nothrow(), and loadDriverFromProperties().
|
private |
Definition at line 44 of file inc/java/sql/Connection.hxx.
Referenced by getDriverClassLoader(), and loadDriverFromProperties().
|
private |
Definition at line 42 of file inc/java/sql/Connection.hxx.
Referenced by construct(), loadDriverFromProperties(), and ~java_sql_Connection().
|
private |
Definition at line 40 of file inc/java/sql/Connection.hxx.
Referenced by construct().
|
staticprotected |
Definition at line 74 of file inc/java/sql/Connection.hxx.
Referenced by getMyClass().