Hello:
I wrote a java class to connect to database and then use JSP to call the java class to get the output that is read from the database.
It give me error. I use WebSphere.
================ some of the code in java class ============
..... other
connectdb,closedb database method under try and catch
wrote a select method under try and catch
wrote main and call connectdb, the quary method and closedb
... others
=========== JSP code =============
.... others
import package
call the java class under try and catch
.. others
======== end
Please help?
Do you want to copy the whole code?
Thank you
sem
Toronto
-
Java class with JSP (1 messages)
- Posted by: sem sam
- Posted on: June 28 2005 00:19 EDT
Threaded Messages (1)
- Java class with JSP by David Crook on July 11 2005 20:31 EDT
-
Java class with JSP[ Go to top ]
- Posted by: David Crook
- Posted on: July 11 2005 20:31 EDT
- in response to sem sam
You don't have nearly enough stuff up there to debug whats going wrong.
But if all you want is to read some stuff out of the DB and dump it on you page you may want to look at the JSTL SQL tag libraries. They will connect to the database and do queries straight from the JSP page. Its not very scalable or easy to maintain, but it does work.
Here is a paper describing how to use them, look about half way down..
http://www-128.ibm.com/developerworks/java/library/j-jstl0520/
You can download a free copy of the JSTL tags from apache.
Good luck