#include "Mainwindow.h"
#include <QApplication>
#include <QtSql/QSqlDatabase>
#include <QtDebug>
#include <QtSql/qsqlquery.h>
#include <QByteArray>
#include <QTextCodec>
#include <QSqlError>
#define MAX_BUFFER_SIZE (200)
typedef unsigned char UCHAR8;
typedef UCHAR8 MESSAGE[MAX_BUFFER_SIZE];
typedef struct _BUFFER
{
Message message;
int length;
}buffer;
int main (int argc, char *argv[])
{
Qapplication A (argc, argv);
Qtextcodec::setcodecforlocale (Qtextcodec::codecforname ("UTF-8"));
Qsqldatabase db = Qsqldatabase::adddatabase ("Qoci");
Db.sethostname ("localhost");
Db.setusername ("SYSTEM");
Db.setpassword ("FuxinOracle2014");
Db.setport (1523);
Db.setdatabasename ("ORCL");
if (Db.open ())
Qdebug () << "open";
Qsqlquery q (DB);
_buffer buf;
memset (&buf, 0, sizeof (_buffer));
buf.length = 1400;
for (int i = 0; i <; i++)
Buf.message[i] = i + ' a ';
for (int i = ten; i <; i++)
Buf.message[i] = ' + ';
for (int i = +; i <; i++)
Buf.message[i] = i + ' a ';
for (int i = +; i <; i++)
Buf.message[i] = ', ';
for (int i = +; i <; i++)
Buf.message[i] = ' a '-I;
Qbytearray by ((char*) buf.message, 1400);
if (Q.prepare ("INSERT into SSSS values (?)"))
{
Q.bindvalue (0,by);
if (Q.exec ())
Qdebug () << "SUS";
Else
Qdebug () << q.lasterror ();
}
Q.exec ("SELECT * from SSSs");
while (Q.next ())
{
Qbytearray by2 = q.value (0). Tobytearray ();
;
}
return A.exec ();
}