Jump to content
JasperReports Library 7.0 is now available ×

Can not run HQL in iReport 1.2.0


2006 IR Open Dicussion

Recommended Posts

By: Welkin Hu - welkinhu

Can not run HQL in iReport 1.2.0

2006-03-01 23:48

I've tried iReport 1.2.0 many times today. I can not run HQL via iReport. it always said "Error: Cannot open connection".

I checked the log, it said "java.sql.SQLException: No suitable driver". I've include my database driver jar into classpath, why no suitable driver?

My database is Oracle. I can connect it via JDBC in iReport. I've add its driver "classes12.jar" to classpath. All my classpath is:

<iReportProperty name="classpath"><![CDATA[..HibernateDataSourcebin

..libdbclasses12.jar

]]></iReportProperty>

 

My hibernate.cfg.xml is correct, It can work in my program.

 

What's wrong!

 

--------------------------------------------------

--iReport Log:

 

2006-03-02 15:34:51,296 [Thread-1] DEBUG - begin

2006-03-02 15:34:51,296 [Thread-1] DEBUG - opening JDBC connection

2006-03-02 15:34:51,296 [Thread-1] DEBUG - total checked-out connections: 0

2006-03-02 15:34:51,296 [Thread-1] DEBUG - opening new JDBC connection

2006-03-02 15:34:51,296 [Thread-1] DEBUG - Cannot open connection [???]

java.sql.SQLException: No suitable driver

at java.sql.DriverManager.getConnection(DriverManager.java:532)

at java.sql.DriverManager.getConnection(DriverManager.java:140)

at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)

at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:360)

at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:122)

at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:125)

at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)

at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1309)

at it.businesslogic.ireport.hibernate.HQLFieldsReader.readFields(HQLFieldsReader.java:133)

at it.businesslogic.ireport.gui.ReportQueryDialog$FieldReader.runHQL(ReportQueryDialog.java:375)

at it.businesslogic.ireport.gui.ReportQueryDialog$FieldReader.run(ReportQueryDialog.java:356)

2006-03-02 15:34:51,296 [Thread-1] WARN - SQL Error: 0, SQLState: 08001

2006-03-02 15:34:51,296 [Thread-1] ERROR - No suitable driver

2006-03-02 15:34:51,296 [Thread-1] DEBUG - closing session

2006-03-02 15:34:51,296 [Thread-1] DEBUG - connection already null in cleanup : no action

 

----------------------------------------------------

--Hibernate Config

<hibernate-configuration>

<session-factory>

<property name="show_sql">true</property>

<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>

<property name="connection.url">jdbc:oracle:thin:@172.17.16.14:1521:ORA14</property>

<property name="connection.username">RPTDEV</property>

<property name="connection.password">RPTDEV</property>

 

<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>

<mapping resource="com/ecv/report/data/DynScheduleHeader.hbm.xml" />

 

</session-factory>

</hibernate-configuration>

 

 

 

 

By: Welkin Hu - welkinhu

Why classpath not work?

2006-03-02 01:40

I have solve this problem.

When I put "classes.zip" to "lib" sub folder of iReport 1.2.0, the HQL works well.

 

But why classpath not work?

 

 

 

 

By: Giulio Toffoli - gt78

RE: Can not run HQL in iReport 1.2.0

2006-03-02 11:38

 

Good question. I'll take a look on this. When does exactly the problem happen?

 

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

Popular Days

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