File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes How to use multiple tables in JSP page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "How to use multiple tables in JSP page" Watch "How to use multiple tables in JSP page" New topic

How to use multiple tables in JSP page

Sriram Padavala

Joined: Aug 07, 2011
Posts: 5

I am creating a page in jsp and I want to use 2 tables in the page with oracle 10g database.

I have a problem because. It is only possible for me to use only one table. How to use the entire database in a jsp page.

I added the table under SystemDSN and used it in the JSP page by the following commands
Connection conn = DriverManager.getConnection("jdbcdbc:logintable","system","manager");

Now I am in use of another table also. But I created the connection using logintable only. So please help me how to use two tables or multiple tables in JSP page. Help me clearly. Because I dont understand many articles.......
Mkunal badgujar

Joined: May 18, 2010
Posts: 5
Hi Sriram,

Please take this step by step. first of all use JSP as view. if you want to use database tables in jsp.

make a connection through separate javaclass use the same for accessing both the tables.

ones you get the result out of both the tables store it in different variables (use beans) and use the same variables the jsp (use scriptlet - not a good practice, but good for initial coding)

I agree. Here's the link:
subject: How to use multiple tables in JSP page
It's not a secret anymore!