• Post Reply Bookmark Topic Watch Topic
  • New Topic

<sql: Datasource > problem  RSS feed

 
Led Estonilo
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, good day to you ranchers. when i read somewhere here at ranch that scriptlets are a bad practice in jsp's i tried working with jstl and EL's. well I think i got a few of it but I came across a new problem. im using JBOSS 4 as my server by the way, here's a part of that jsp code



when I try to run my code, it throws this problem


DataSource invalid: "Java.SQLException: no suitable driver found for jdbc/mySqlE"


whats wrong here? i got



declared in my web.xml and


in my Jboss-ds.xml. ive used "jdbc/mySqle","jname", and "java:jdbc/mySqlE" as dataSource string variables but none works

well using servlets to query and it works, whats wrong here?


 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, scriptlets are no longer considered good practice in JSPs. Unfortunately, neither is the use of SQL in JSPs considered a good practice, even with use of the JSTL SQL tags (which even the spec says not to use for anything other than prototyping).

I'd factor your database code out into Java classes that are UI-independent.
 
Led Estonilo
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

wha... and now <sql: >tags in JSP's is not a good practice anymore?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It never was. The Spec even says so.
 
Led Estonilo
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<< not reading spec before using it.

thanks anyways.maybe ill stick with the old plain java classes
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!