Jump to content
JasperReports Library 7.0 is now available ×

Connect to mySQL


2005 IR Help

Recommended Posts

By: Romy Yuliawan - snricek

Connect to mySQL

2001-11-28 01:28

Hi...

I've compiled sample file FirstJasper.xml.

I used mySQL database, and I've changed JDBC driver on JasperReportsTestApp.

 

Code:
String driver = "com.caucho.jdbc.mysql.Driver"; 
String connectString = "jdbc:mysql-caucho://192.168.200.5:3306/Northwind";

 

When I run the taskFill.bat file, an error raised..

 

C:JRmysql>C:JDK1.3binjava.exe -classpath ./;C:common-libjasperreports.jar;
C:JDK1.3libtools.jar;C:common-libcommons-beanutils.jar;C:common-libcommon
s-collections.jar;C:common-libcommons-digester.jar;C:common-libxerces.jar;C:
common-libiText.jar;C:common-libcaucho-jdbc-mysql-0.2.7.jar -Dorg.xml.sax.dr
iver=org.apache.xerces.parsers.SAXParser JasperReportsTestApp -Tfill -FFirstJasp
er.jasper
Exception in thread "main" java.lang.NoClassDefFoundError: com/caucho/vfs/LogStr
eam
at com.caucho.jdbc.mysql.Driver.<clinit>(Driver.java)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at JasperReportsTestApp.getConnection(JasperReportsTestApp.java:118)
at JasperReportsTestApp.main(JasperReportsTestApp.java:60)

 

 

I have include "caucho-jdbc-mysql-0.2.7.jar"

Thanks...

 

 

By: Teodor Danciu - teodord

RE: Connect to mySQL

2001-11-28 23:12

 

Hi,

 

This error is related to your JDBC driver.

It seems that it needs also another library

since it doesn't find that class:

com.caucho.vfs.LogStream

Maybe you should check if there is another

JAR file that you should have in the CLASSPATH

along with the caucho-jdbc-mysql-0.2.7.jar.

 

But I have a question for you:

My sample uses the table Orders from the

Northwind sample database that comes with

Microsoft SQL Server.

Are you sure that on your mySQL server there

is a similar Northwind database?

Have you imported it from MS SQL Server?

If not, I will be not surprise if the sample

application wouldn't work.

 

For the moment, I don't have a sample specially

designed for some mySQL default database.

But I'm thinking of it.

 

Good luck!

Teodor

 

 

 

By: Romy Yuliawan - snricek

RE: Connect to mySQL

2001-11-30 01:50

What should I do to set the classpath ?

if my file configuration look like this:

 

Java :
C:JDK1.3
Jasper Engine:
C:common-lib
Jasper Application:
C:JRmysql

 

I have imported Northwind from SQL server into mySQL, but only Orders table ;)

 

Thanks,

romy

Post edited by: tcloonan, at: 2006/08/12 18:16

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...