Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

JSTL SQL syntax for database attribute with a space in between

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am working on a project that was designed 10 year back and some of the attributes name in that database has a space in between.

For example Company Name

if there a way to get this value using

<sql:setDataSource dataSource="jdbc/_Ob" />
<sql:query var="selectedRows"
sql="select * from SystemUser where SystemUserID = ?">
<sql:param value = "${SYSTEMUSERID}"/>
</sql:query>
<c:forEach var="currentRow" items="${selectedRows.rows}">
<c:set var="CompanyName" value="${currentRow.['Company Name']}" />
....



thanks in advance
 
Marshal
Posts: 67445
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this is a legacy app, why are you introducing the JSTL SQL tags into it when those should only be used for prototyping?
 
Rajibul Alam
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:If this is a legacy app, why are you introducing the JSTL SQL tags into it when those should only be used for prototyping?



I am writing the whole application using J2EE but still need to use the old database .....and Using the JSTLSQL tags just for Select to show data in profile pages. All main SQl are done in Servlets.

I guess I can use Beans to store the values from a servlet and then pass em through session n show em in the JSP but I felt that might be too much for the purpose.

But If you have any suggestions then I would really appreciate it. Plus the main Question remains...Is it possible to access [Company name] (attribute with a space) value in JSTL.
 
Bear Bibeault
Marshal
Posts: 67445
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know the answer to your question because I would never use the JSTL SQL tags for anything.

I strongly recommend you do the same.
 
There's a hole in the bucket, dear Liza, dear Liza, a hole in the bucket, dear liza, a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic