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