Jump to content
Changes to the Jaspersoft community edition download ×

problem with classpath and connections


2004 IR Help

Recommended Posts

By: Chalk S. Bareng - chalksb

problem with classpath and connections

2002-10-24 23:17

Hi =)

I have just installed iReport.

I have a problem with making new connections.

This is the error whenever I test a connection:

ClassNotFoundError: sun/jdbc/odbc/JdbcOdbc

Check your classpath!

 

But I already configured iReport. These are

the contents of my Classpath form, am I missing

out on something? Thanks.

 

CLASSPATH MS JVM:

C:\WINNTjavatrustlib

C:\WINNTjavaclasses

C:\WINNTjavaPackages

 

CLASSPATH (env variable):

c:iReportbin

c:JasperReportslibcommons-beanutils.jar

c:JasperReportslibcommons-collections.jar

c:JasperReportslibcommons-digester.jar

c:JasperReportslibitext-0.92.jar

c:JasperReportslibjasperreports.jar

c:JasperReportslibxerces.jar

c:JasperReportslibtools.jar

 

JAVA HOME:

C:jdk1.3.1_04

 

 

 

 

 

By: Giulio Toffoli - gt78

RE: problem with classpath and connections

2002-10-25 01:40

Now I try to solve your problem. Please wait...

 

Giulio

 

 

 

 

By: Giulio Toffoli - gt78

RE: problem with classpath and connections

2002-10-25 04:53

Hi Chalk,

the problem is simple, but the solution is not so simple...

 

Fundamentally the problem is sun/jdbc/odbc/JdbcOdbc. You can solve the ClassNotFound Exception adding c:jdk1.3...jrelibrt.jar to your classpath, but this is not the final solution because I don't understand why the registered Dirver sun.jdbc.odbc.JdbcOdbcDriver is not correctly registered by MS JVM (#@!): I get ever the SQLException: No suitable driver for url jdbc:odbc:MYDATASOURCE, that is a correct url for the sun' driver. I have tried to check url using acceptsURL() method for sun's driver correctly instanced and I got effectively a true result, but only God knows why it don't run...

 

Solution: the solution will be simple in next release 0.0.5, for now the ConnectionForm of iReport don't help because it crash when I make what we will make.

 

Setp 1. Open connections.properties.

Step 2. Write this code:

CONX_DRIVER=com.ms.jdbc.odbc.JdbcOdbcDriver

CONX_URL=jdbc:odbcl:MYDATASOURCE

CONX_DATABASE=

CONX_PASSWORD=mypass

CONX_USERNAME=myusername

CONX_SAVE=true

CONX_NAME=MS_ODBC_YDATASOURCE

 

You must replace "CONX" with the first free connection "slot" (for example if you have 3 connections {CON0,CON1 and CON2), CONX will be CON3).

 

Now run iReport.You must create a new connection similar to CONX, but using the sun driver. We will use this connection for IReportCompiler (that is executed in a pure Java environment)

 

Use MS_ODBC_YDATASOURCE inside iReport (wizard, query tool, ...) and select SUN_ODBC in iReport compiler window.

 

I hope is all clear

Ciao

 

Giulio

 

 

 

 

 

By: Johnson Davis - bubbacg

RE: problem with classpath and connections

2002-10-26 09:09

I had the same problem and tried the workaround without success. With many combinations of JVM and Java classpaths I still get class not found on both the com.ms.jdbc.odbc.JdbcOdbcDriver and sun.jdbc.odbc.JdbcOdbcDriver. Are there any additional prerequisites, like the SDK for Java from Microsoft or such? The system I am testing on has the J2 SDK 1.4 from Sun, and the current JVM from Microsoft (IE 6 SP1). There are no Microsoft development tools installed.

 

 

 

 

By: Giulio Toffoli - gt78

RE: problem with classpath and connections

2002-10-26 10:52

It's impossible that there is a ClassNotFound exception for com.ms.jdbc.odbc.JdbcOdbcDriver when you use use it inside JasperReports...

BUT....no problem. I'm releasing version 0.0.5. Probally it is out this night,,, stay tuned, I will resolve your problem ,the compatibility with ODBC is too much important for Win32 users!

 

Giulio

 

 

 

 

By: Chalk S. Bareng - chalksb

RE: problem with classpath and connections

2002-10-27 19:05

Thank you very much, it's working now. =)

 

 

 

 

 

By: Giulio Toffoli - gt78

RE: problem with classpath and connections

2002-10-28 00:33

OK. I'm very happy. This was a important feature!

 

Giulio

 

 

 

 

By: Lenny Ridel - lennyridel

RE: problem with classpath and connections

2002-10-28 07:37

I have a problem with mysql driver. It can nit locate the driver.

Lenny

 

 

 

 

 

By: Giulio Toffoli - gt78

RE: problem with classpath and connections

2002-10-28 07:56

The mysql JDBC dirver is not shipped with iReport. You must modify MS JVM classpath and Sun classpath to find mysql drivers.

Download, If you don't have still made it, the mysql JDBC driver. Go to menu database->classpath Add the jar file containing mysql JDBC drivers to both classpaths.

Try now to create and test a new MySQL connection.

You can take a look to http://ireport.sourceforge.net/docs.html

 

Giulio

 

 

 

 

By: Zoran Lazarevic - zoranl

RE: problem with classpath and connections

2002-10-28 10:47

I tried 0.0.5 with DB2 and there is a problem with classpath too. When I add db2java.zip (JDBC drivers for DB2) to the classpath, I always receive msg "... can not find driver. Check classpath...".

I had to unzip all classes to the root of IReport, and then the connection worked fine.

 

Hope it helps,

Zoran

 

 

 

 

By: Giulio Toffoli - gt78

RE: problem with classpath and connections

2002-10-28 11:14

Infact the iReport directory is ever in all classpaths(both MSJVM and SunJVM)

 

Thanks Zoran ;-)

 

Giulio

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...