Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> OCCI question

OCCI question

From: agzis <agzis_at_yahoo.com>
Date: 4 Oct 2003 18:44:17 -0700
Message-ID: <6594f651.0310041744.240e2534@posting.google.com>


Hi,
 I have code :header and source files.
Header is:
#include <occi.h>

using namespace oracle::occi;
using namespace std;

class OraTest
{
public:

	OraTest(string sid, string user, string pwd) throw (SQLException);
	virtual ~OraTest() throw (SQLException);

	void displayAllRows ();

private:

    Environment * m_pEnvironment;
    Connection * m_pConnection;

    OraTest(); //disallow this ctor

};

Source is:
#include "stdafx.h"

#include "..\INCLUDE\OraTest1.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

OraTest::OraTest(string sid, string user, string pwd) throw (SQLException) {

	m_pEnvironment = Environment::createEnvironment(Environment::DEFAULT);
	m_pConnection  = m_pEnvironment->createConnection (user, pwd, sid);

}

OraTest::~OraTest() throw (SQLException){

	m_pEnvironment->terminateConnection(m_pConnection);
	Environment::terminateEnvironment(m_pEnvironment);

}

/**
* displaying all the rows in the table
*/
void OraTest::displayAllRows (){

	Statement *stmt = m_pConnection->createStatement (
	"SELECT table_name FROM user_tables where rownum=2");
	stmt->execute ();
	ResultSet *rs = stmt->getResultSet ();
	
	
	while (rs->next ())
	{
		::MessageBox (NULL, rs->getString(1).c_str(), "displayAllRows",
MB_OK);
	}
	stmt->closeResultSet (rs);
	m_pConnection->terminateStatement (stmt);

}

///////////
Call routine is:
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
 	// TODO: Place code here.

	try {
		OraTest *pOraTest = new OraTest ("PCTS","scott", "tiger");
		pOraTest->displayAllRows ();

		delete (pOraTest);
    } 
	catch (SQLException e) {

		::MessageBox(NULL, e.getMessage().c_str(), "SQLException",MB_OK);
	}

	return 0;

}

//////////////

When I call function displayAllRows() i receive message in a place m_pConnection->terminateStatement (stmt). Messsage is "User breakpoint called from code at 0x77f75a58" in NTDLL.

Why this happened and how to get rid of it? Thank you in advance.

Alex. Received on Sat Oct 04 2003 - 20:44:17 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US