473,473 Members | 2,054 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

strange problem

Hello All,

I have strange problem with libodbc++ ( 0.2.3 or 0.2.2 ).
i'm using mysql-4.0.14 , MyODBC-3.51.06 and unixODBC-2.2.6
configured with following options

1.MySQL
../configure --prefix=/usr/local/test --with-openssl
--with-mysqld-user=root --enable-thread-safe-client --with-pthread
--enable-shared
2.unixODBC
../configure --prefix=/usr/local/test --sysconfdir=/etc
--enable-threads=yes
3.MyODBC
../configure --prefix=/usr/local/test
--with-mysql-libs=/usr/local/MailQubeBuild/lib/mysql
--with-mysql-includes=/usr/local/MailQubeBuild/include/mysql
--with-unixODBC=/usr/local/MailQubeBuild --enable-thread-safe
4.libodbc
../configure --prefix=/usr/local/test
--with-odbc=/usr/local/MailQubeBuild --enable-threads

OS is a Red Hat 7.3

and problem is that when i'm trying to write to database - all is ok
but when i try to read i get empty resultsets

here is a test code which fails :

void _perform_test()
{
int iCnt = 0;
long lID = 0;
odbc::Statement* stmt = NULL;
odbc::ResultSet* rset = NULL;
std::string csQuery;

LogLineToLogServer(MQ_LOG_NOTICE, "[80200] !!!!!!!!!!!!!! Testing DB
!!!!!!!!!!!!!!");

odbc::PreparedStatement* rs=connDBConnection->prepareStatement
("create table tmp__ ( testfld int(1))TYPE=INNODB ;");
try {
rs->executeUpdate();

}
catch (odbc::SQLException& e ) {
LogLineToLogServer(MQ_LOG_NOTICE, "[12011] Database exception %s",
e.getMessage().c_str() );
if( rs ) delete rs;
}
rs=connDBConnection->prepareStatement ("insert into tmp__
values(1)");
try {
rs->executeUpdate();

}
catch (odbc::SQLException& e ) {
LogLineToLogServer(MQ_LOG_NOTICE, "[12011] Database exception %s",
e.getMessage().c_str() );
if( rs ) delete rs;
}
csQuery += "SELECT * FROM tmp__";
try {
stmt=connDBConnection->createStatement();
}
catch (odbc::SQLException& e ) {
LogLineToLogServer(MQ_LOG_NOTICE, "[12011] Database exception %s",
e.getMessage().c_str() );
if( stmt ) delete stmt;
}
try {
rset=stmt->executeQuery(csQuery);
while(rset->next()) {
lID = rset->getLong ( "testfld" );
iCnt++;
}
}
catch (odbc::SQLException& e ) {
LogLineToLogServer(MQ_LOG_NOTICE, "[12011] Database exception %s",
e.getMessage().c_str() );
if( rs ) { delete rset; rset = NULL; }
if( stmt ) { delete stmt; stmt = NULL; }
}

rs=connDBConnection->prepareStatement ("drop table tmp__");
try {
rs->executeUpdate();

}
catch (odbc::SQLException& e ) {
LogLineToLogServer(MQ_LOG_NOTICE, "[12011] Database exception %s",
e.getMessage().c_str() );
if( rs ) delete rs;
return 0;
}
if( iCnt != 1 || lID != 1 )
LogLineToLogServer(MQ_LOG_NOTICE, "[80200] !!!!!!!!!!!!!! ERROR
!!!!!!!!!!!!!!");
else
LogLineToLogServer(MQ_LOG_NOTICE, "[80200] !!!!!!!!!!!!!! TEST
PASSED !!!!!!!!!!!!!!");
}
and problem is that each time i get ERROR :)

so may be someone can help me?
best wishes,

decho
Jul 19 '05 #1
0 1858

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Rob Ristroph | last post by:
Hi, It's pretty unhelpful to post "I have a huge piece of code that crashes in strange places, what's the problem?" but that's basically my problem and I really am at my wit's end. The piece...
2
by: Paul Drummond | last post by:
Hi all, I am developing software for Linux Redhat9 and I have noticed some very strange behaviour when throwing exceptions within a shared library. All our exceptions are derived from...
25
by: Neil Ginsberg | last post by:
I have a strange situation with my Access 2000 database. I have code in the database which has worked fine for years, and now all of a sudden doesn't work fine on one or two of my client's...
2
by: TB | last post by:
I am seeing a very strange problem as follows... I have a loop where a fair amount of processing is going on and near the top of the loop I access a class that has only static helper functions...
1
by: Sam Kong | last post by:
Hello! Recently I had a strange problem with Visual C# 2005 beta 1. When I ran(F5 key) a program, <#if DEBUG> statement was not working. It ran as RELEASE mode. So I had to manually define...
8
by: Spam Trap | last post by:
I am getting strange resizing problems when using an inherited form. Controls are moving themselves seemingly randomly, but reproducibly. "frmBase" is my base class (a windows form), and...
11
by: Martin Joergensen | last post by:
Hi, I've encountered a really, *really*, REALLY strange error :-) I have a for-loop and after 8 runs I get strange results...... I mean: A really strange result.... I'm calculating...
12
by: StephQ | last post by:
I have a class Bounds with two constructors: class Bounds { private: list<SegmentupperLinearSpline; // Upper bound. list<SegmentlowerLinearSpline; // Lower bound. ....
8
by: Dox33 | last post by:
I ran into a very strange behaviour of raw_input(). I hope somebody can tell me how to fix this. (Or is this a problem in the python source?) I will explain the problem by using 3 examples....
5
by: ioni | last post by:
Good day, fellows! I have a strange problem – at my site there is a flash strip, that loads data dynamically. It works fine (grabs data from the remote server and presents it), however in IE7...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.