Use of getHDBC() method of sun.jdbc.odbc.JdbcOdbcConnection
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Friday, June 1, 2001 06:07 AM

In my Java application, I make a connection to a database via JDBC-ODBC. My Java application communicates with a C++ application. On the C++ side we would like to use the same database connection. I tried to pass the value returned by JdbcOdbcConnection.getHDBC() to the C++ side. getHDBC() returns an integer value. It is received as an unsigned long in C++ and converted to a void*. When I'm running the following C++ code ... /* HENV myEnv; HDBC myHdbc; // HDBC value returned HSTMT myHSTMT; SQLAllocEnv(&myEnv); SQLAllocStmt(myHdbc,&myHstmt) */ ... an EXCEPTION_ACCESS_VIOLATION is sent. On SQLAllocStmt, the t   More>>

In my Java application, I make a connection to a database via JDBC-ODBC.
My Java application communicates with a C++ application.
On the C++ side we would like to use the same database connection.

I tried to pass the value returned by JdbcOdbcConnection.getHDBC() to the C++
side.

getHDBC() returns an integer value.
It is received as an unsigned long in C++ and converted to a void*.

When I'm running the following C++ code ...
/*
HENV myEnv;
HDBC myHdbc; // HDBC value returned
HSTMT myHSTMT;

SQLAllocEnv(&myEnv);
SQLAllocStmt(myHdbc,&myHstmt)
*/
... an EXCEPTION_ACCESS_VIOLATION is sent.

On SQLAllocStmt, the thread attempted to read inaccessible data.
The address of the inaccessible data is the one returned by
JdbcOdbcConnection.getHDBC().

Any help would be appreciated.
Thank you.


Configuration:

hardware: x86
OSversion: win_nt_4.0
Classic VM (build JDK-1.2.2_006, native threads, symcjit)

   <<Less
About | Sitemap | Contact