wood burning stoves 2.0*
The moose likes JDBC 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
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to use multiple tables in JSP page" Watch "How to use multiple tables in JSP page" New topic
Author

How to use multiple tables in JSP page

Sriram Padavala
Greenhorn

Joined: Aug 07, 2011
Posts: 5
Hello,

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
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
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
Greenhorn

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: http://aspose.com/file-tools
 
subject: How to use multiple tables in JSP page