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

Posted on 2010-08-24
Last Modified: 2012-05-10
Exception in thread "main" java.lang.RuntimeException: Can't parse an expression rm.exec('SELECT depname, empname, payment, bonus FROM employee e, department d where = e.depid order by age desc')
at net.sf.jxls.tag.ForEachTag.parseItemsProperty(
at net.sf.jxls.tag.ForEachTag.init(
at net.sf.jxls.parser.CellParser.parseTag(
at net.sf.jxls.parser.CellParser.parseCellValue(
at net.sf.jxls.parser.CellParser.parseCell(
at net.sf.jxls.transformer.SheetTransformer.parseCells(
at net.sf.jxls.transformer.SheetTransformer.parseRow(
at net.sf.jxls.transformer.SheetTransformer.transformSheet(
at net.sf.jxls.transformer.XLSTransformer.transformWorkbook(
at net.sf.jxls.transformer.XLSTransformer.transformXLS(
at net.sf.jxls.transformer.XLSTransformer.transformXLS(
at net.sf.jxls.sample.ReportingSample.main(
Caused by: java.sql.SQLException: Column 'name' not found.
at com.mysql.jdbc.SQLError.createSQLException(
at com.mysql.jdbc.SQLError.createSQLException(
at com.mysql.jdbc.SQLError.createSQLException(
at com.mysql.jdbc.ResultSetImpl.findColumn(
at com.mysql.jdbc.ResultSetImpl.getObject(
at org.apache.commons.beanutils.JDBCDynaClass.getObject(
at org.apache.commons.beanutils.RowSetDynaClass.copy(
at org.apache.commons.beanutils.RowSetDynaClass.<init>(
at org.apache.commons.beanutils.RowSetDynaClass.<init>(
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(
at org.apache.commons.jexl.parser.ASTMethod.execute(
at org.apache.commons.jexl.parser.ASTReference.execute(
at org.apache.commons.jexl.parser.ASTReference.value(
at org.apache.commons.jexl.parser.ASTReferenceExpression.value(
at org.apache.commons.jexl.ExpressionImpl.evaluate(
at net.sf.jxls.parser.Expression.evaluate(
at net.sf.jxls.tag.ForEachTag.parseItemsProperty(
Question by:rajumuchunde
  • 3
  • 2
  • 2
LVL 92

Expert Comment

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

Expert Comment

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

Open in new window

LVL 86

Expert Comment

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

Open in new window

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.


Author Comment

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

Expert Comment

ID: 33530620
Please post your current code
LVL 92

Accepted Solution

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

you need to change it to fix the column name

Author Closing Comment

ID: 33549220
alias name problems

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Android studio getdrawable(int) is deprecated 4 119
numbers ascending pyramid 101 212
Maven Project: Hibernate Dependencies Conflict 10 39
javap not working 8 58
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

860 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