• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Spring MVC JDBC

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Everybody, I am trying to figure out how to get the following query to work. In a jsp file, so named page1.jsp, contains

a href with a property listing name that a user selects such as "Phillies" ( ${teamsNLEast.name} ). This property name is then

passed into a variable called teamName to then be subsequently directed to the where clause in the following query.

Here is the class that contains the query and uses the getJdbcTemplate and query methods to process the sql statement, with the

where clause set to teamName, and assigns it to a List of players.

This is where the returned sql result from above will call the mapRow() method to match the value player_name in the database

and set it to the player object.

This class implements a getPlayers method that returns a playerlisting to a player data access object from the provided

teamName argument.

And finally my question arises at the Controller where the getPlayers method ought to be passed the teamName string. Though,

when I try to do that I'm receiving a compilation error. Does anyone have an idea on what I'm doing wrong? Your help is

greatly appreciated.


 
author & internet detective
Posts: 41083
848
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
MLBControllerPage2 doesn't have a player manager injected or passed as a parameter. Therefore it can't compile because a dependency is missing.
 
karl czukoski
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:MLBControllerPage2 doesn't have a player manager injected or passed as a parameter. Therefore it can't compile because a dependency is missing.



Thanks Jeanne, could you provide some more detail or an example on how this particular injection is performed?
 
Sometimes you feel like a nut. Sometimes you feel like a tiny ad.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic