diff options
author | Ocke Janssen <oj@openoffice.org> | 2001-01-09 11:58:40 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2001-01-09 11:58:40 +0000 |
commit | 52426450243dfdffabb7f6e5765bc51cc9079349 (patch) | |
tree | 2b03e8acbd2a219466f0bd7f0d2f2e66b2179362 | |
parent | e432aff42b61f3e2dc5e4ac467ac18a9b9eb14fe (diff) |
impl metadata
-rw-r--r-- | connectivity/source/drivers/jdbc/PreparedStatement.cxx | 29 | ||||
-rw-r--r-- | connectivity/source/inc/java/sql/PreparedStatement.hxx | 18 |
2 files changed, 39 insertions, 8 deletions
diff --git a/connectivity/source/drivers/jdbc/PreparedStatement.cxx b/connectivity/source/drivers/jdbc/PreparedStatement.cxx index b234923df1ac..7c1a9f8d09fe 100644 --- a/connectivity/source/drivers/jdbc/PreparedStatement.cxx +++ b/connectivity/source/drivers/jdbc/PreparedStatement.cxx @@ -2,9 +2,9 @@ * * $RCSfile: PreparedStatement.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-11 10:46:14 $ + * last change: $Author: oj $ $Date: 2001-01-09 12:58:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,6 +64,9 @@ #ifndef _CONNECTIVITY_JAVA_SQL_RESULTSET_HXX_ #include "java/sql/ResultSet.hxx" #endif +#ifndef _CONNECTIVITY_JAVA_SQL_RESULTSETMETADATA_HXX_ +#include "java/sql/ResultSetMetaData.hxx" +#endif #ifndef _CONNECTIVITY_JAVA_SQL_CONNECTION_HXX_ #include "java/sql/Connection.hxx" #endif @@ -136,6 +139,7 @@ void java_sql_PreparedStatement::saveClassRef( jclass pClass ) { ::cppu::OTypeCollection aTypes( ::getCppuType( (const ::com::sun::star::uno::Reference< XPreparedStatement > *)0 ), ::getCppuType( (const ::com::sun::star::uno::Reference< XParameters > *)0 ), + ::getCppuType( (const ::com::sun::star::uno::Reference< XResultSetMetaDataSupplier > *)0 ), ::getCppuType( (const ::com::sun::star::uno::Reference< XPreparedBatchExecution > *)0 )); return ::comphelper::concatSequences(aTypes.getTypes(),OStatement_BASE2::getTypes()); @@ -838,5 +842,26 @@ void SAL_CALL java_sql_PreparedStatement::addBatch( ) throw(::com::sun::star::sd return aSeq; } // ------------------------------------------------------------------------- +::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL java_sql_PreparedStatement::getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) +{ + jobject out(0); + SDBThreadAttach t; OSL_ENSHURE(t.pEnv,"Java Enviroment gelscht worden!"); + if( t.pEnv ) + { + // temporaere Variable initialisieren + char * cSignature = "()Ljava/sql/ResultSetMetaData;"; + char * cMethodName = "getMetaData"; + // Java-Call absetzen + jmethodID mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature ); + if( mID ){ + out = t.pEnv->CallObjectMethod( object, mID ); + ThrowSQLException(t.pEnv,*this); + } //mID + } //t.pEnv + // ACHTUNG: der Aufrufer wird Eigentuemer des zurueckgelieferten Zeigers !!! + return out==0 ? 0 : new java_sql_ResultSetMetaData( t.pEnv, out ); +} +// ----------------------------------------------------------------------------- + diff --git a/connectivity/source/inc/java/sql/PreparedStatement.hxx b/connectivity/source/inc/java/sql/PreparedStatement.hxx index 1fd2131714e3..1bcf9c4cf17a 100644 --- a/connectivity/source/inc/java/sql/PreparedStatement.hxx +++ b/connectivity/source/inc/java/sql/PreparedStatement.hxx @@ -2,9 +2,9 @@ * * $RCSfile: PreparedStatement.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:14:26 $ + * last change: $Author: oj $ $Date: 2001-01-09 12:58:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -74,6 +74,9 @@ #ifndef _COM_SUN_STAR_SDBC_XPREPAREDBATCHEXECUTION_HPP_ #include <com/sun/star/sdbc/XPreparedBatchExecution.hpp> #endif +#ifndef _COM_SUN_STAR_SDBC_XRESULTSETMETADATASUPPLIER_HPP_ +#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp> +#endif #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> #endif @@ -85,10 +88,11 @@ namespace connectivity //************************************************************** class java_sql_PreparedStatement : public OStatement_BASE2, - public ::com::sun::star::sdbc::XPreparedStatement, - public ::com::sun::star::sdbc::XParameters, - public ::com::sun::star::sdbc::XPreparedBatchExecution, - public ::com::sun::star::lang::XServiceInfo + public ::com::sun::star::sdbc::XPreparedStatement, + public ::com::sun::star::sdbc::XResultSetMetaDataSupplier, + public ::com::sun::star::sdbc::XParameters, + public ::com::sun::star::sdbc::XPreparedBatchExecution, + public ::com::sun::star::lang::XServiceInfo { protected: // statische Daten fuer die Klasse @@ -140,6 +144,8 @@ namespace connectivity virtual void SAL_CALL addBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL clearBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL executeBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + // XResultSetMetaDataSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); }; } #endif // _CONNECTIVITY_JAVA_SQL_PREPAREDSTATEMENT_HXX_ |