Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-07-2012, 06:33 AM   PM User | #1
djmb1011
New to the CF scene

 
Join Date: Jul 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
djmb1011 is an unknown quantity at this point
How do I use select box to put names of DB tables and so on?

Hello guys, I have been creating a webpage with jsp and html.

I reached to a process where I need to connect database in order to bring table list, column list and data recorded in each column.

In order to do that, I separate the scenario in DBconnect.html and process.jsp; here's what I'm thinking.

==========DBconnect.html==========

1. use textbox to get user id, pw and server ip address.
2. use button named 'connect' to send above information to process.jsp
3. create three select boxes in order to receive names of instances, tables, columns respectively.


==========process.jsp============

1. Use received information from DBconnect.html to connect database.
2. Create statements to bring certain data and Execute them in order to receive outcomes from Database.
3. Once data is received, use while loop to show data one by one, and send them to appropriate option values.

So I create these complementary pages and I couldn't figure out how to code while loop and select box properly in order to bring data from process.jsp to option values in DBconnect.html

Here's my while loop statement in process.jsp and I have no clue how to export this values into option values.

[CODE]
while(rs.next()) {
String instance = rs.getString("INSTANCE");
System.out.println(instance);
}
[CODE]
Also, since it is my first time coding the webpage, I am still not sure if creating two complementary pages is the best solution.

Please, help me out and tell me if there's any better solutions to create such a page.

Thank you
djmb1011 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:17 PM.


Advertisement
Log in to turn off these ads.