• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

CDATA in EJB-ql

 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Weblogic Guys
Can you explain this.
I was going through teh DD of 1 runnign application
where i found this entry for EJB-QL
************************************************************
<ejb-ql>
<![CDATA[WHERE (name = ?1) ORDERBY shortDescription]]>
</ejb-ql>
************************************************************
Is this a valid entry . Since it works i reckon yes.
In ohter containers i see the whole select statement(select object(m) from ......) being used what is this
CDATA stuff in Weblogic.
Could some one explain me what does CDATA translate into.

rgrds
 
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Manish,
AFAIK, CDATA is used when you need to specify special characters in a tag of an XML file. I guess this ejb-ql is incorrect as it misses "select ... from ..." statement.
Also, ORDER BY is not a part of EJB 2.0 spec, though WL may still support it, I don't know.
 
Chicken Farmer ()
Posts: 1932
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm moving this to the XML forum since it doesn't relate to any certifications.
 
author
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
CDATA sections are pure syntax sugar, nothing more. This is discussed in Item 15 of of Effective XML, "Build on top of structures, not syntax"
<ejb-ql>
<![CDATA[WHERE (name = ?1) ORDERBY shortDescription]]>
</ejb-ql>
is exactly equivalent to
<ejb-ql>
WHERE (name = ?1) ORDERBY shortDescription
</ejb-ql>
In this case the CDATA section was completely pointless. However, in the general case it might be used to let authors include < and & characters without escaping them. I suspect some tool here is simply wrapping all SQL queries in CDATA sections rather than take the time to figure out which if any characters need to be escaped. That's all.
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Also, ORDER BY is not a part of EJB 2.0 spec, though WL may still support it, I don't know


It is supported in EJB 2.1
 
Where does a nanny get ground to air missles? Protect this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic