what if any are the recommended ways of accessing a database using jdbc from a
c++ application?
I have a large c++ app suite with a database layer that may need to change how
it accessed a variety of db's, so I thought I would find out if it was
reasonable/possible to use jdbc from c++.
thanks
Jeff
Jeff Kish
Arne Vajhøj - 02 Nov 2007 23:52 GMT
> what if any are the recommended ways of accessing a database using jdbc from a
> c++ application?
[quoted text clipped - 3 lines]
> reasonable/possible to use jdbc from c++.
> thanks
You don't use JDBC in C++.
You could use JNI to call some Java code from your C++ code and let
the Java code use JDBC, but that would be extremely cumbersome.
Use another database API.
ODBC, OLE DB, your database vendors embedded SQL, a proprietary
library from your database vendor.
Arne
Lee Fesperman - 04 Nov 2007 21:32 GMT
> what if any are the recommended ways of accessing a database using jdbc from a
> c++ application?
There are commercial odbc-jdbc drivers. A couple can be found at
www.openlinksw.com and www.easysoft.com. I don't have any experience
with them, but they undoubtedly use JNI. You can also google 'odbc-
jdbc drivers'.
--
Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
Roedy Green - 04 Nov 2007 23:29 GMT
>what if any are the recommended ways of accessing a database using jdbc from a
>c++ application?
You would not use JDBC. Most SQL engines will come with a C++ library
for accessing it directly.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Lothar Kimmeringer - 06 Nov 2007 19:00 GMT
> what if any are the recommended ways of accessing a database using jdbc from a
> c++ application?
If you want to use something like the JDBC-framework, you might
take a look at http://libodbcxx.sourceforge.net/ but I don't
know anything about the current status and the quality of
the library.
Regards, Lothar

Signature
Lothar Kimmeringer E-Mail: spamfang@kimmeringer.de
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)
Always remember: The answer is forty-two, there can only be wrong
questions!