Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qsql_db2.cpp File Reference
#include "qsql_db2_p.h"
#include <qcoreapplication.h>
#include <qdatetime.h>
#include <qlist.h>
#include <qsqlerror.h>
#include <qsqlfield.h>
#include <qsqlindex.h>
#include <qsqlrecord.h>
#include <qstringlist.h>
#include <qvarlengtharray.h>
#include <QDebug>
#include <QtSql/private/qsqldriver_p.h>
#include <QtSql/private/qsqlresult_p.h>
#include "private/qtools_p.h"
#include <sqlcli1.h>
#include <string.h>
+ Include dependency graph for qsql_db2.cpp:

Go to the source code of this file.

Classes

class  QDB2DriverPrivate
 
class  QDB2Result
 
class  QDB2ResultPrivate
 

Functions

static QString qFromTChar (SQLTCHAR *str)
 
static SQLTCHAR * qToTChar (const QString &str)
 
static QString qWarnDB2Handle (int handleType, SQLHANDLE handle, int *errorCode)
 
static QString qDB2Warn (const QDB2DriverPrivate *d, QStringList *errorCodes=nullptr)
 
static QString qDB2Warn (const QDB2ResultPrivate *d, QStringList *errorCodes=nullptr)
 
static void qSqlWarning (const QString &message, const QDB2DriverPrivate *d)
 
static void qSqlWarning (const QString &message, const QDB2ResultPrivate *d)
 
static QSqlError qMakeError (const QString &err, QSqlError::ErrorType type, const QDB2DriverPrivate *p)
 
static QSqlError qMakeError (const QString &err, QSqlError::ErrorType type, const QDB2ResultPrivate *p)
 
static QMetaType qDecodeDB2Type (SQLSMALLINT sqltype)
 
static QSqlField qMakeFieldInfo (const QDB2ResultPrivate *d, int i)
 
static int qGetIntData (SQLHANDLE hStmt, int column, bool &isNull)
 
static double qGetDoubleData (SQLHANDLE hStmt, int column, bool &isNull)
 
static SQLBIGINT qGetBigIntData (SQLHANDLE hStmt, int column, bool &isNull)
 
static QString qGetStringData (SQLHANDLE hStmt, int column, int colSize, bool &isNull)
 
static QByteArray qGetBinaryData (SQLHANDLE hStmt, int column, SQLLEN &lengthIndicator, bool &isNull)
 
static QSqlField qMakeFieldInfo (const SQLHANDLE hStmt)
 
static bool qMakeStatement (QDB2ResultPrivate *d, bool forwardOnly, bool setForwardOnly=true)
 

Variables

static const int COLNAMESIZE = 255
 
static const SQLSMALLINT TABLENAMESIZE = 128
 
static const SQLSMALLINT qParamType [4] = { SQL_PARAM_INPUT, SQL_PARAM_INPUT, SQL_PARAM_OUTPUT, SQL_PARAM_INPUT_OUTPUT }
 

Function Documentation

◆ qDB2Warn() [1/2]

static QString qDB2Warn ( const QDB2DriverPrivate d,
QStringList errorCodes = nullptr 
)
static

Definition at line 152 of file qsql_db2.cpp.

References d, error, QString::number(), and qWarnDB2Handle().

Referenced by QDB2Result::exec(), qMakeError(), qMakeError(), qSqlWarning(), and qSqlWarning().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qDB2Warn() [2/2]

static QString qDB2Warn ( const QDB2ResultPrivate d,
QStringList errorCodes = nullptr 
)
static

Definition at line 168 of file qsql_db2.cpp.

References d, error, QString::number(), and qWarnDB2Handle().

+ Here is the call graph for this function:

◆ qDecodeDB2Type()

static QMetaType qDecodeDB2Type ( SQLSMALLINT  sqltype)
static

Definition at line 221 of file qsql_db2.cpp.

References QMetaType::UnknownType.

Referenced by qMakeFieldInfo(), and qMakeFieldInfo().

+ Here is the caller graph for this function:

◆ qFromTChar()

static QString qFromTChar ( SQLTCHAR *  str)
static

Definition at line 117 of file qsql_db2.cpp.

References str.

Referenced by qGetStringData(), qMakeFieldInfo(), and qWarnDB2Handle().

+ Here is the caller graph for this function:

◆ qGetBigIntData()

static SQLBIGINT qGetBigIntData ( SQLHANDLE  hStmt,
int  column,
bool &  isNull 
)
static

Definition at line 355 of file qsql_db2.cpp.

References Q_INT64_C.

Referenced by QDB2Result::data().

+ Here is the caller graph for this function:

◆ qGetBinaryData()

static QByteArray qGetBinaryData ( SQLHANDLE  hStmt,
int  column,
SQLLEN &  lengthIndicator,
bool &  isNull 
)
static

Definition at line 412 of file qsql_db2.cpp.

References QByteArray::append(), COLNAMESIZE, and qWarning.

Referenced by QDB2Result::data().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qGetDoubleData()

static double qGetDoubleData ( SQLHANDLE  hStmt,
int  column,
bool &  isNull 
)
static

Definition at line 336 of file qsql_db2.cpp.

Referenced by QDB2Result::data().

+ Here is the caller graph for this function:

◆ qGetIntData()

static int qGetIntData ( SQLHANDLE  hStmt,
int  column,
bool &  isNull 
)
static

Definition at line 318 of file qsql_db2.cpp.

Referenced by QDB2Result::data(), and qMakeFieldInfo().

+ Here is the caller graph for this function:

◆ qGetStringData()

static QString qGetStringData ( SQLHANDLE  hStmt,
int  column,
int  colSize,
bool &  isNull 
)
static

Definition at line 372 of file qsql_db2.cpp.

References QString::clear(), qFromTChar(), and qWarning.

Referenced by QDB2Result::data(), QDB2Driver::primaryIndex(), QODBCDriver::primaryIndex(), qMakeFieldInfo(), QDB2Driver::tables(), and QODBCDriver::tables().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qMakeError() [1/2]

static QSqlError qMakeError ( const QString err,
QSqlError::ErrorType  type,
const QDB2DriverPrivate p 
)
static

◆ qMakeError() [2/2]

static QSqlError qMakeError ( const QString err,
QSqlError::ErrorType  type,
const QDB2ResultPrivate p 
)
static

Definition at line 212 of file qsql_db2.cpp.

References error, qDB2Warn(), and QStringLiteral.

+ Here is the call graph for this function:

◆ qMakeFieldInfo() [1/2]

static QSqlField qMakeFieldInfo ( const QDB2ResultPrivate d,
int  i 
)
static

Definition at line 276 of file qsql_db2.cpp.

References arg, COLNAMESIZE, d, QString::fromLatin1(), i, qDecodeDB2Type(), qFromTChar(), qSqlWarning(), and TABLENAMESIZE.

Referenced by QDB2Result::exec(), QDB2Result::nextResult(), QDB2Driver::record(), QODBCDriver::record(), and QDB2Result::reset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qMakeFieldInfo() [2/2]

static QSqlField qMakeFieldInfo ( const SQLHANDLE  hStmt)
static

Definition at line 494 of file qsql_db2.cpp.

References qDecodeDB2Type(), qGetIntData(), and qGetStringData().

+ Here is the call graph for this function:

◆ qMakeStatement()

static bool qMakeStatement ( QDB2ResultPrivate d,
bool  forwardOnly,
bool  setForwardOnly = true 
)
static

Definition at line 512 of file qsql_db2.cpp.

References arg, d, QString::fromLatin1(), qSqlWarning(), and setForwardOnly().

Referenced by QDB2Result::exec(), QDB2Result::prepare(), and QDB2Result::reset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qSqlWarning() [1/2]

static void qSqlWarning ( const QString message,
const QDB2DriverPrivate d 
)
static

Definition at line 191 of file qsql_db2.cpp.

References d, qDB2Warn(), qWarning, and toLocal8Bit().

Referenced by QDB2Result::~QDB2Result(), QDB2Driver::close(), QDB2Result::numRowsAffected(), QDB2Driver::open(), QODBCDriver::open(), QDB2Driver::primaryIndex(), QODBCDriver::primaryIndex(), qMakeFieldInfo(), qMakeStatement(), QDB2DriverPrivate::qSplitTableQualifier(), QDB2Driver::record(), QODBCDriver::record(), QDB2Driver::tables(), and QODBCDriver::tables().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qSqlWarning() [2/2]

static void qSqlWarning ( const QString message,
const QDB2ResultPrivate d 
)
static

Definition at line 197 of file qsql_db2.cpp.

References d, qDB2Warn(), qWarning, and toLocal8Bit().

+ Here is the call graph for this function:

◆ qToTChar()

static SQLTCHAR * qToTChar ( const QString str)
static

Definition at line 124 of file qsql_db2.cpp.

References str, and QString::utf16().

Referenced by QDB2Driver::open(), QDB2Result::prepare(), QDB2Driver::primaryIndex(), QDB2Driver::record(), QDB2Result::reset(), and QDB2Driver::tables().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qWarnDB2Handle()

static QString qWarnDB2Handle ( int  handleType,
SQLHANDLE  handle,
int *  errorCode 
)
static

Definition at line 129 of file qsql_db2.cpp.

References qFromTChar(), and state.

Referenced by qDB2Warn(), and qDB2Warn().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ COLNAMESIZE

const int COLNAMESIZE = 255
static

Definition at line 35 of file qsql_db2.cpp.

Referenced by qGetBinaryData(), and qMakeFieldInfo().

◆ qParamType

const SQLSMALLINT qParamType[4] = { SQL_PARAM_INPUT, SQL_PARAM_INPUT, SQL_PARAM_OUTPUT, SQL_PARAM_INPUT_OUTPUT }
static

Definition at line 40 of file qsql_db2.cpp.

Referenced by QDB2Result::exec().

◆ TABLENAMESIZE

const SQLSMALLINT TABLENAMESIZE = 128
static

Definition at line 39 of file qsql_db2.cpp.

Referenced by qMakeFieldInfo().