Need help - Stuck with a ClassNotFoundException
"Bhagwat, Ameesha" <[email protected]>
| Newsgroups | gmane.comp.java.ikvm.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello there!
I am trying to call some basic Java code from a C# class for loading a jdbc driver as below:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using java.io;
using java.sql;
using java.util;
using java.lang;
//using ro.nextreports.engine;
//using ro.nextreports.engine.util;
//using ro.nextreports.engine.chart;
/*
using ro.nextreports.engine.ReportRunner;
using ro.nextreports.engine.util.LoadReportException;
using ro.nextreports.engine.util.ReportUtil;
*
* */
//using ro.nextreports.integration.*;
namespace Prototype
{
class Program
{
static void Main(string[] args)
{
new Program().getConnection();
}
public void getConnection() //throws ClassNotFoundException, SQLException
{
Class.forName("net.sourceforge.jtds.jdbc.Driver"); // java.lang.System.out.println("Connect to '" + connectionURL + "'");
}
}
}
However on running the exe I am getting the error below: (I have included all IKVM dlls in the same project as references and in the same directory as the exe)
Unhandled Exception: java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc
.Driver
at IKVM.NativeCode.java.lang.Class.forName0(String name, Boolean initialize,
ClassLoader loader)
at java.lang.Class.forName(String className, CallerID )
at java.lang.Class.forName(String className)
at Prototype.Program.getConnection() in c:\Users\ameesha.bhagwat-ctr\Document
s\Visual Studio 2010\Projects\Prototype\Prototype\Program.cs:line 66
at Prototype.Program.Main(String[] args) in c:\Users\ameesha.bhagwat-ctr\Docu
ments\Visual Studio 2010\Projects\Prototype\Prototype\Program.cs:line 59
Any idea what could be the issue pls.?
Thanks so much for your help, you developers rock!!
-Ameesha
This email is from an employee of QinetiQ North America’s (QNA) Services and Solutions Group (SSG), which has been acquired by The SI Organization, Inc. Although SSG is in the process of changing its name, some contracts, certifications, and other documents may continue to refer to QinetiQ North America. New Email addresses will be effective on 25 June and after this transition, messages will be forwarded from the previous email address.
The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Ikvm-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ikvm-developers