473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Calling java (.jar) from C++?

Hi there,
I have a need to call a java database library from C++ applications. Can
anyone point me in the right direction on how to accomplish this?

Thanks.
Apr 28 '06 #1
4 2035
"cada0310" wrote:
I have a need to call a java database library from C++ applications. Can
anyone point me in the right direction on how to accomplish this?


I think you would be better off using something like ODBC, ADO .NET, etc.,
to access the underlying database directly if you have any choice in the
matter.

Is there some particular reason you must use the Java interface with the C++
app?

Sean
Apr 28 '06 #2
"cada0310" <ca******@discussions.microsoft.com> wrote in message
news:21**********************************@microsof t.com...
Hi there,
I have a need to call a java database library from C++ applications. Can
anyone point me in the right direction on how to accomplish this?


You need to host the JVM in your application and use the JVM hosting
interfaces to access the Java library. Search the Sun Java site for
information about hosting the JVM.

As another respondent already pointed out, there's likely a better way to
accomplish what you need, but the Java interface library is your only
choice, JVM hosting is what you need.

-cd
Apr 28 '06 #3
cada0310 wrote:
Hi there,
I have a need to call a java database library from C++ applications. Can
anyone point me in the right direction on how to accomplish this?

Thanks.

1. using Java Native Interface (JNI)
refer
http://java.sun.com/j2se/1.5.0/docs/...ec/jniTOC.html

However, it will be complex and painful task.
2. if you use C++ in Dotnet (managed C++), you can try the
Javaimplementation in Dotnet - IKVM.

refer "http://www.ikvm.net/"

If lucky, you can convert the java library to a Dotnet assembly and call
it as normal Dotent library.
--
Jacky Kwok
jacky@alumni_DOT_cuhk_DOT_edu_DOT_hk
jacky@compose_DOT_com_DOT_hk
Apr 29 '06 #4
IKVM is not a standard!
May 7 '06 #5

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

Similar topics

2
by: Radha News | last post by:
Hi, I am looking for reference books/tools/code samples for calling java objects/methods from COM/C++ classes. I am reasonably familiar with JNI. If you have used JNI, please let me know of...
7
by: Klaus Friese | last post by:
Hi, i'm currently working on a plugin for Adobe InDesign and i have some problems with that. I'm not really a c++ guru, maybe somebody here has an idea how to solve this. The plugin is...
3
by: Joe DeAngelo | last post by:
As well known Java and C++ can call each other by using a technology called JNI. Is there a similar technology for calling java from/to csharp? Joe
7
by: Christian Wilhelm | last post by:
Hi! I'm trying to call a Java WebService out of a .net Client. There are two Methods, one Method requires one Parameter of type Parameter, the other Method requires one Parameter of type...
4
by: simon | last post by:
hello, may have a need shortly to call a java class from a vb.net web app. basically the java class would serve as an email creation/sending function. i realize this all could be done in .net,...
0
by: dappyl | last post by:
Hi,... I have an example shell script to run command prompt. It works fine.. the code shown below : <% Dim wshell, intReturn set wshell = server.createobject("wscript.shell") intReturn...
4
by: Dan | last post by:
Hi All, I've got a problem with my C++ application that calls a Java class that I've built with GCJ, I can't run it because I get errors: multiple definition of `atexit' first defined here...
1
by: Andryanus | last post by:
Hello everyone, Does anyone have experience accessing Java Jar Object with ASP? Please kindly advise. Thank you.
2
by: lilly07 | last post by:
Hi, I have to call ' java -jar name.jar arg1 arg2' in my perl script. The java prints a string if we invoke the above command How to capture this information. Thanks and regards.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.