Kaydet (Commit) f98a193a authored tarafından Andrzej J.R. Hunt's avatar Andrzej J.R. Hunt

Implement the first parts of FPreparedStatement.

Change-Id: Iad9561fa6b200ce5efcacc4c0b7b822aaaf9adb0
üst 291b8796
......@@ -73,21 +73,22 @@ namespace connectivity
};
::std::vector< Parameter> m_aParameters;
//====================================================================
// Data attributes
//====================================================================
TTypeInfoVector m_aTypeInfo; // Hashtable containing an entry
// for each row returned by
// DatabaseMetaData.getTypeInfo.
sal_Int32 m_nNumParams; // Number of parameter markers
// for the prepared statement
::rtl::OUString m_sSqlStatement;
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > m_xMetaData;
sal_Bool m_bPrepared;
void checkParameterIndex(sal_Int32 _parameterIndex);
isc_stmt_handle m_statementHandle;
XSQLDA* m_pOutSqlda;
XSQLDA* m_pInSqlda;
void checkParameterIndex(sal_Int32 nParameterIndex)
throw(::com::sun::star::sdbc::SQLException);
void ensurePrepared()
throw(::com::sun::star::sdbc::SQLException);
protected:
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,
......@@ -117,7 +118,7 @@ namespace connectivity
virtual sal_Bool SAL_CALL execute( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
// XParameters
virtual void SAL_CALL setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setNull( sal_Int32 nParameterIndex, sal_Int32 sqlType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setBoolean( sal_Int32 parameterIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
......
......@@ -210,7 +210,7 @@ OUString OStatement_Base::sanitizeSqlString(const OUString& sqlIn)
{
// TODO: verify this is all we need.
static const sal_Unicode pattern('"');
static const sal_Unicode empty('\'');
static const sal_Unicode empty(' ');
return sqlIn.replace(pattern, empty);
}
......@@ -297,11 +297,13 @@ int OStatement_Base::prepareAndDescribeStatement(const OUString& sqlIn,
return aErr;
}
uno::Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery(const OUString& sql) throw(SQLException, RuntimeException)
uno::Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery(const OUString& sqlIn) throw(SQLException, RuntimeException)
{
MutexGuard aGuard(m_pConnection->getMutex());
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
const OUString sql = sanitizeSqlString(sqlIn);
XSQLDA* pOutSqlda = 0;
isc_stmt_handle aStatementHandle = 0;
int aErr = 0;
......
......@@ -77,7 +77,6 @@ namespace connectivity
OConnection* m_pConnection;
XSQLDA * m_INsqlda;
ISC_STATUS_ARRAY m_statusVector;
protected:
......@@ -146,7 +145,6 @@ namespace connectivity
// other methods
OConnection* getOwnConnection() const { return m_pConnection;}
inline XSQLDA * getINsqlda() const { return m_INsqlda; }
};
class OStatement_BASE2 :public OStatement_Base
......
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