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

Remove some unnecessary uses of XSQLDA->sqlvar (firebird-sdbc).

Change-Id: I69ea81a66decb817d5962206e4a6c30537bce02c
üst 28a6e1cf
...@@ -325,31 +325,22 @@ Reference< XStatement > SAL_CALL OConnection::createStatement( ) ...@@ -325,31 +325,22 @@ Reference< XStatement > SAL_CALL OConnection::createStatement( )
} }
Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement(
const ::rtl::OUString& _sSql ) throw(SQLException, RuntimeException) const OUString& _sSql)
throw(SQLException, RuntimeException)
{ {
SAL_INFO("connectivity.firebird", "prepareStatement(). " SAL_INFO("connectivity.firebird", "prepareStatement() "
"Got called with sql: " << _sSql); "called with sql: " << _sSql);
MutexGuard aGuard(m_aMutex);
MutexGuard aGuard( m_aMutex );
checkDisposed(OConnection_BASE::rBHelper.bDisposed); checkDisposed(OConnection_BASE::rBHelper.bDisposed);
// the pre
if(m_aTypeInfo.empty()) if(m_aTypeInfo.empty())
buildTypeInfo(); buildTypeInfo();
SAL_INFO("connectivity.firebird", "prepareStatement(). "
"Creating prepared statement.");
// create a statement
// the statement can only be executed more than once
Reference< XPreparedStatement > xReturn = new OPreparedStatement(this, Reference< XPreparedStatement > xReturn = new OPreparedStatement(this,
m_aTypeInfo, m_aTypeInfo,
_sSql); _sSql);
m_aStatements.push_back(WeakReferenceHelper(xReturn)); m_aStatements.push_back(WeakReferenceHelper(xReturn));
SAL_INFO("connectivity.firebird", "prepareStatement(). "
"Prepared Statement created.");
return xReturn; return xReturn;
} }
......
...@@ -215,8 +215,7 @@ OUString OStatement_Base::sanitizeSqlString(const OUString& sqlIn) ...@@ -215,8 +215,7 @@ OUString OStatement_Base::sanitizeSqlString(const OUString& sqlIn)
int OStatement_Base::prepareAndDescribeStatement(const OUString& sqlIn, int OStatement_Base::prepareAndDescribeStatement(const OUString& sqlIn,
isc_stmt_handle& aStatementHandle, isc_stmt_handle& aStatementHandle,
XSQLDA*& pOutSqlda, XSQLDA*& pOutSqlda)
XSQLVAR*& pVar)
{ {
MutexGuard aGuard(m_pConnection->getMutex()); MutexGuard aGuard(m_pConnection->getMutex());
...@@ -281,7 +280,7 @@ int OStatement_Base::prepareAndDescribeStatement(const OUString& sqlIn, ...@@ -281,7 +280,7 @@ int OStatement_Base::prepareAndDescribeStatement(const OUString& sqlIn,
1, 1,
pOutSqlda); pOutSqlda);
} }
pVar = pOutSqlda->sqlvar; XSQLVAR* pVar = pOutSqlda->sqlvar;
// Process each XSQLVAR parameter structure in the output XSQLDA // Process each XSQLVAR parameter structure in the output XSQLDA
if (aErr) if (aErr)
...@@ -364,16 +363,13 @@ uno::Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery(const OUStri ...@@ -364,16 +363,13 @@ uno::Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery(const OUStri
checkDisposed(OStatement_BASE::rBHelper.bDisposed); checkDisposed(OStatement_BASE::rBHelper.bDisposed);
XSQLDA* pOutSqlda = 0; XSQLDA* pOutSqlda = 0;
XSQLVAR* pVar = 0;
isc_stmt_handle aStatementHandle = 0; isc_stmt_handle aStatementHandle = 0;
int aErr = 0; int aErr = 0;
aErr = prepareAndDescribeStatement(sql, aErr = prepareAndDescribeStatement(sql,
aStatementHandle, aStatementHandle,
pOutSqlda, pOutSqlda);
pVar);
if (aErr) if (aErr)
{ {
SAL_WARN("connectivity.firebird", "prepareAndDescribeStatement failed"); SAL_WARN("connectivity.firebird", "prepareAndDescribeStatement failed");
...@@ -411,15 +407,13 @@ sal_Bool SAL_CALL OStatement_Base::execute(const OUString& sql) throw(SQLExcepti ...@@ -411,15 +407,13 @@ sal_Bool SAL_CALL OStatement_Base::execute(const OUString& sql) throw(SQLExcepti
checkDisposed(OStatement_BASE::rBHelper.bDisposed); checkDisposed(OStatement_BASE::rBHelper.bDisposed);
XSQLDA* pOutSqlda = 0; XSQLDA* pOutSqlda = 0;
XSQLVAR* pVar = 0;
isc_stmt_handle aStatementHandle = 0; isc_stmt_handle aStatementHandle = 0;
int aErr = 0; int aErr = 0;
aErr = prepareAndDescribeStatement(sql, aErr = prepareAndDescribeStatement(sql,
aStatementHandle, aStatementHandle,
pOutSqlda, pOutSqlda);
pVar);
if (aErr) if (aErr)
{ {
......
...@@ -77,7 +77,6 @@ namespace connectivity ...@@ -77,7 +77,6 @@ namespace connectivity
OConnection* m_pConnection; OConnection* m_pConnection;
XSQLDA * m_OUTsqlda;
XSQLDA * m_INsqlda; XSQLDA * m_INsqlda;
ISC_STATUS_ARRAY m_statusVector; ISC_STATUS_ARRAY m_statusVector;
protected: protected:
...@@ -104,8 +103,7 @@ namespace connectivity ...@@ -104,8 +103,7 @@ namespace connectivity
virtual ~OStatement_Base(); virtual ~OStatement_Base();
int prepareAndDescribeStatement(const OUString& sqlIn, int prepareAndDescribeStatement(const OUString& sqlIn,
isc_stmt_handle& aStatementHandle, isc_stmt_handle& aStatementHandle,
XSQLDA*& pOutSqlda, XSQLDA*& pOutSqlda);
XSQLVAR*& pVar);
::rtl::OUString sanitizeSqlString(const OUString& sqlIn); ::rtl::OUString sanitizeSqlString(const OUString& sqlIn);
public: public:
...@@ -147,7 +145,6 @@ namespace connectivity ...@@ -147,7 +145,6 @@ namespace connectivity
// other methods // other methods
OConnection* getOwnConnection() const { return m_pConnection;} OConnection* getOwnConnection() const { return m_pConnection;}
inline XSQLDA * getOUTsqlda() const { return m_OUTsqlda; }
inline XSQLDA * getINsqlda() const { return m_INsqlda; } inline XSQLDA * getINsqlda() const { return m_INsqlda; }
}; };
......
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