I am wondering which is the most effective way to display database information (i.e. say a table) w/JSP.
 
I can't really find any examples on or anything so here is what I have come up with:
 
create a bean that has 3 methods
 
openDB()
returnRow()
closeDB()
 
call the openDB() method open JDBC connection
use a loop in the jsp file and call the returnRow() method to return one row
closeDB() method to close resources.
 
OR
 
create a bean that opens,returns all the SQL query rows into a vector and then use another method that you call through the jsp file to iterate through the vector.  The close the DB connection.
 
? Now am I way off here?  Can I open a db connection inside a jsp scriptlet?
 

Reply via email to