Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Spring and the fly likes Cannot get new screen to work properly; similar screen was recently added successfully Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Cannot get new screen to work properly; similar screen was recently added successfully" Watch "Cannot get new screen to work properly; similar screen was recently added successfully" New topic
Author

Cannot get new screen to work properly; similar screen was recently added successfully

William Peck
Ranch Hand

Joined: Dec 18, 2009
Posts: 54
I recently added a screen to a small application, everything worked out fine. The Oracle data looks like this:

# Errors Description
755 MED_COV Dup Found
453 MEM_MEMB_TEFRA Dup Found
6 MEM_MEMB_WHCR Dup Found

So my next screen is to drill down on one of the above rows to display all "755 errors", with some additional detail.

The error I keep getting is "Invalid Column Name", but the two screens are using (virtually) the same sql, etc. Here's the error:
Error 500: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select et.srce_sys_cd, trunc(et.load_dt) as date_loaded, et.fld_nm, et.mtrcs_errs_linkg_id from stage3i.err_tbl et where et.mtrcs_errs_linkg_id = to_number(4413) order by et.fld_nm, et.ent_key_id ]; nested exception is java.sql.SQLException: Invalid column name

I think the spring-servlet file is wrong, that's something I don't quite understand. In the first code snippet, "summary" is my good screen but "detail" gets the error.

I "re-use" some pieces of the code but obviously I'm tripped up somewhere.

I've also provided all the components for the working screen ("summary") and the screen with the error ("detail"). Since I had just wrestled with the first screen (and got it working), I don't think it's my screen, I thing it's the spring-mvc file.

Here's a snippet from my spring-mvc file



Here's the code shared between the two sreens:


Here's the components for the screen that works :



Here are the pieces for the screen that doesn't work


Bill in Baltimore
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

the two screens are using (virtually) the same sql

They are not virtually the same, they are different
1. Does the ent_key_id column exist ?
2. Why are you setting "linkingId" in ErrorListDetailDAOImpl although it's not used ?
3. Did you try to execute the SQL via a tool like SQL*Plus ?

[My Blog]
All roads lead to JavaRanch
William Peck
Ranch Hand

Joined: Dec 18, 2009
Posts: 54
Christophe Verré wrote:
the two screens are using (virtually) the same sql

They are not virtually the same, they are different


Well, my point was it's using the same "select" statement [except for the "count(*) ] and the group by.

1. Does the ent_key_id column exist ?

3. Did you try to execute the SQL via a tool like SQL*Plus ?


yes, the Sql works fine in Sql*Plus

2. Why are you setting "linkingId" in ErrorListDetailDAOImpl although it's not used ?


Once I get the screen working, I'll remove the hard-coded "to_number(4413)" and replace it with "to_number(:linkingId)
William Peck
Ranch Hand

Joined: Dec 18, 2009
Posts: 54
I built it a second time and it worked . . . but thanks anyway.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot get new screen to work properly; similar screen was recently added successfully