Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / April 2006

Tip: Looking for answers? Try searching our database.

Calling java (.jar) from C++?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cada0310 - 28 Apr 2006 19:16 GMT
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.
Sean M. DonCarlos - 28 Apr 2006 19:36 GMT
> 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
Carl Daniel [VC++ MVP] - 28 Apr 2006 20:37 GMT
> 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
jacky kwok - 29 Apr 2006 02:37 GMT
> Hi there,
>  
[quoted text clipped - 3 lines]
>
> Thanks.

1. using Java Native Interface (JNI)
refer
http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/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.

Signature

Jacky Kwok
jacky@alumni_DOT_cuhk_DOT_edu_DOT_hk
jacky@compose_DOT_com_DOT_hk


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.