Kaydet (Commit) c8d91a8f authored tarafından Kate Goss's avatar Kate Goss Kaydeden (comit) Lionel Elie Mamane

Remove unused code from connectivity::odbc::OPreparedStatement

Remove methods getDataBuf(int), getParamLength(int), getPrecision(int).
üst cdb2d21c
......@@ -673,27 +673,6 @@ sal_Int8* OPreparedStatement::allocBindBuf( sal_Int32 index,sal_Int32 bufLen)
}
// -------------------------------------------------------------------------
//--------------------------------------------------------------------
// getDataBuf
// Gets the data buffer for the given parameter index
//--------------------------------------------------------------------
sal_Int8* OPreparedStatement::getDataBuf (sal_Int32 index)
{
sal_Int8* b = NULL;
// Sanity check the parameter number
if ((index >= 1) &&
(index <= numParams))
{
b = boundParams[index - 1].getBindDataBuffer ();
}
return b;
}
// -------------------------------------------------------------------------
//--------------------------------------------------------------------
// getLengthBuf
// Gets the length buffer for the given parameter index
......@@ -715,34 +694,6 @@ sal_Int8* OPreparedStatement::getLengthBuf (sal_Int32 index)
}
// -------------------------------------------------------------------------
//--------------------------------------------------------------------
// getParamLength
// Returns the length of the given parameter number. When each
// parameter was bound, a 4-sal_Int8 buffer was given to hold the
// length (stored in native format). Get the buffer, convert the
// buffer from native format, and return it. If the length is -1,
// the column is considered to be NULL.
//--------------------------------------------------------------------
sal_Int32 OPreparedStatement::getParamLength ( sal_Int32 index)
{
sal_Int32 paramLen = SQL_NULL_DATA;
// Sanity check the parameter number
if ((index >= 1) &&
(index <= numParams)) {
// Now get the length of the parameter from the
// bound param array. -1 is returned if it is NULL.
long n = 0;
memcpy (&n, boundParams[index -1].getBindLengthBuffer (), sizeof (n));
paramLen = n;
}
return paramLen;
}
// -------------------------------------------------------------------------
//--------------------------------------------------------------------
// putParamData
// Puts parameter data from a previously bound input stream. The
......@@ -810,34 +761,6 @@ void OPreparedStatement::putParamData (sal_Int32 index) throw(SQLException)
}
}
// -------------------------------------------------------------------------
//--------------------------------------------------------------------
// getPrecision
// Given a SQL type, return the maximum precision for the column.
// Returns -1 if not known
//--------------------------------------------------------------------
sal_Int32 OPreparedStatement::getPrecision ( sal_Int32 sqlType)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
sal_Int32 prec = -1;
const TTypeInfoVector& rTypeInfo = m_pConnection->getTypeInfo();
if ( !rTypeInfo.empty() )
{
m_pConnection->buildTypeInfo();
}
if ( !rTypeInfo.empty() )
{
OTypeInfo aInfo;
aInfo.nType = (sal_Int16)sqlType;
TTypeInfoVector::const_iterator aIter = ::std::find(rTypeInfo.begin(),rTypeInfo.end(),aInfo);
if(aIter != rTypeInfo.end())
prec = (*aIter).nPrecision;
}
return prec;
}
//--------------------------------------------------------------------
// setStream
......
......@@ -88,15 +88,11 @@ namespace connectivity
void putParamData (sal_Int32 index) throw(::com::sun::star::sdbc::SQLException);
void setStream (sal_Int32 ParameterIndex,const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream>& x,
SQLLEN length,sal_Int32 SQLtype) throw(::com::sun::star::sdbc::SQLException);
sal_Int32 getParamLength ( sal_Int32 index);
sal_Int8* getLengthBuf (sal_Int32 index);
sal_Int8* getDataBuf (sal_Int32 index);
sal_Int8* allocBindBuf ( sal_Int32 index, sal_Int32 bufLen);
void initBoundParam () throw(::com::sun::star::sdbc::SQLException);
void setParameter(sal_Int32 parameterIndex,sal_Int32 _nType,sal_Int32 _nSize,void* _pData);
sal_Int32 getPrecision ( sal_Int32 sqlType);
sal_Bool isPrepared() const { return m_bPrepared;}
void prepareStatement();
void checkParameterIndex(sal_Int32 _parameterIndex);
......
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