Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Can't parse an expression rm.exec using jxls package

Posted on 2010-08-24
7
Medium Priority
?
2,466 Views
Last Modified: 2012-05-10
Exception in thread "main" java.lang.RuntimeException: Can't parse an expression rm.exec('SELECT d.name depname, e.name empname, payment, bonus FROM employee e, department d where d.id = e.depid order by age desc')
at net.sf.jxls.tag.ForEachTag.parseItemsProperty(ForEachTag.java:142)
at net.sf.jxls.tag.ForEachTag.init(ForEachTag.java:104)
at net.sf.jxls.parser.CellParser.parseTag(CellParser.java:294)
at net.sf.jxls.parser.CellParser.parseCellValue(CellParser.java:196)
at net.sf.jxls.parser.CellParser.parseCell(CellParser.java:57)
at net.sf.jxls.transformer.SheetTransformer.parseCells(SheetTransformer.java:193)
at net.sf.jxls.transformer.SheetTransformer.parseRow(SheetTransformer.java:263)
at net.sf.jxls.transformer.SheetTransformer.transformSheet(SheetTransformer.java:82)
at net.sf.jxls.transformer.XLSTransformer.transformWorkbook(XLSTransformer.java:238)
at net.sf.jxls.transformer.XLSTransformer.transformXLS(XLSTransformer.java:217)
at net.sf.jxls.transformer.XLSTransformer.transformXLS(XLSTransformer.java:196)
at net.sf.jxls.sample.ReportingSample.main(ReportingSample.java:38)
Caused by: java.sql.SQLException: Column 'name' not found.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
at com.mysql.jdbc.ResultSetImpl.findColumn(ResultSetImpl.java:1093)
at com.mysql.jdbc.ResultSetImpl.getObject(ResultSetImpl.java:4951)
at org.apache.commons.beanutils.JDBCDynaClass.getObject(JDBCDynaClass.java:271)
at org.apache.commons.beanutils.RowSetDynaClass.copy(RowSetDynaClass.java:232)
at org.apache.commons.beanutils.RowSetDynaClass.<init>(RowSetDynaClass.java:187)
at org.apache.commons.beanutils.RowSetDynaClass.<init>(RowSetDynaClass.java:152)
at net.sf.jxls.report.ReportManagerImpl.exec(ReportManagerImpl.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:231)
at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:104)
at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:82)
at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:56)
at org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:50)
at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:79)
at net.sf.jxls.parser.Expression.evaluate(Expression.java:69)
at net.sf.jxls.tag.ForEachTag.parseItemsProperty(ForEachTag.java:135)
0
Comment
Question by:rajumuchunde
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 92

Expert Comment

by:objects
ID: 33518515
appears you are try to use a column name that does not exist
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 33518872
Try
rm.exec('SELECT d.name depname, e.name empname, e.payment payment, e.bonus bonus, e.age age FROM employee e, department d where d.id = e.depid order by age desc')

Open in new window

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 33518887
You might be able to simplify that to
rm.exec('SELECT d.name depname, e.name empname, e.payment, e.bonus FROM employee e, department d where d.id = e.depid order by e.age desc')

Open in new window

0
The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

 

Author Comment

by:rajumuchunde
ID: 33530431
error remain same inspite of changing query .
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 33530620
Please post your current code
0
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 33536942
> error remain same inspite of changing query .

you need to change it to fix the column name
0
 

Author Closing Comment

by:rajumuchunde
ID: 33549220
alias name problems
0

Featured Post

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question