Discussion:
JSTLExamples NetBean Sample Project
Tim Puchala
2011-10-27 09:14:23 UTC
Permalink
I’m trying to run explore SQL Tags section of the sample project provided by NetBeans called JSTLExamples
I changed the database url to use sample rather than the default jstl-sample because that is the databes in the Services pane under Databases. The schema is APP and the user is app.
I used app and app for user and password.
I am getting an SQLException when executing the QueryIterate option (first on the page).
The description of the exception is “No suitable driver found for jdbc:derby://localhost:1527/sample;create=true
I have tried adding the jar file derbyclient.jar to the project library, but this doesn’t correct the error.
I would have thought the project shouldn’t need tweaking like this anyway if it’s a sample project provided by Netbeans.
Any ideas, anybody?
Stani Ryabenkiy
2011-10-27 15:21:41 UTC
Permalink
Hi Tim,

1) using SQL tags in a JSP is a bad design choice, I recommend against it.
SQL belongs in the model layer, not the presentation layer.
2) I am not familiar with how NetBeans does things nor have I tried Derby
but to me this sounds like a typical Tomcat class loader problem. The SQL
tags (or whatever is looking for the Derby driver) are outside your
application (loaded by Tomcat's common class loader) so they cannot see the
Derby classes loaded inside your application. Try locating the Tomcat
installation that NetBeans is starting and add the Derby driver jar to the
lib folder in there, that will most likely fix it.

Good Luck,
Stani
Post by Tim Puchala
I’m trying to run explore SQL Tags section of the sample project provided
by NetBeans called JSTLExamples
I changed the database url to use sample rather than the default
jstl-sample because that is the databes in the Services pane under
Databases. The schema is APP and the user is app.
I used app and app for user and password.
I am getting an SQLException when executing the QueryIterate option (first on the page).
The description of the exception is “No suitable driver found for
jdbc:derby://localhost:1527/sample;create=true
I have tried adding the jar file derbyclient.jar to the project library,
but this doesn’t correct the error.
I would have thought the project shouldn’t need tweaking like this anyway
if it’s a sample project provided by Netbeans.
Any ideas, anybody?
Stuart Thiel
2011-10-27 15:54:18 UTC
Permalink
Hi Tim/Stani,

I'd go so far as to say SQL doesn't even belong in the model layer as
per Fowler/Larmen/whomever 3-layer approaches.

My recommendation is to use some form of Controller servlet that takes
care of much of what is needed, like setting up connections and setting
attributes (not directly, see Fowler's P of EAA or my thesis --if you're
a masochist--
https://soenea.htmlweb.com/trac/browser/Documentation/trunk/Thesis/Thesis_Stuart.pdf).
This allows problems like that to be addressed in the appropriate
places, leaving the JSP Templates oblivious to it all and letting the
jstl stuff stick to providing appropriate support to display relevant
data in the JSPs. Even if your abstraction was less religiously (Domain)
Object-Oriented than what I propose, having your jstl stuff just
manipulate some form of ResultSet/DAO would probably achieve appropriate
separation, with problems like missing database drivers happening before
the JSP is even dispatched to (and possibly leading to the dispatching
to an error view).

Stuart
Post by Stani Ryabenkiy
Hi Tim,
1) using SQL tags in a JSP is a bad design choice, I recommend against it.
SQL belongs in the model layer, not the presentation layer.
2) I am not familiar with how NetBeans does things nor have I tried Derby
but to me this sounds like a typical Tomcat class loader problem. The SQL
tags (or whatever is looking for the Derby driver) are outside your
application (loaded by Tomcat's common class loader) so they cannot see the
Derby classes loaded inside your application. Try locating the Tomcat
installation that NetBeans is starting and add the Derby driver jar to the
lib folder in there, that will most likely fix it.
Good Luck,
Stani
I’m trying to run explore SQL Tags section of the sample project provided
by NetBeans called JSTLExamples
I changed the database url to use sample rather than the default
jstl-sample because that is the databes in the Services pane under
Databases. The schema is APP and the user is app.
I used app and app for user and password.
I am getting an SQLException when executing the QueryIterate option (first on the page).
The description of the exception is “No suitable driver found for
jdbc:derby://localhost:1527/sample;create=true
I have tried adding the jar file derbyclient.jar to the project library,
but this doesn’t correct the error.
I would have thought the project shouldn’t need tweaking like this anyway
if it’s a sample project provided by Netbeans.
Any ideas, anybody?
Loading...