Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet Important Question
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


sanjay baniwal
Important Question
5 Answer(s)      2 years and 7 months ago
Posted in : JSP-Servlet


Respected Sir, I am Sanjay Baniwal working in BHEL as a Software Developer as a trainee for One Year. And i have been given a Project in which i have to create a JSP page with a Drop Down List in which all the UserNames in the Account table from SQL Database should come Automatically whenever the JSP page is Requested. Kindly see to it as soon as possible. It's urgent.

Regards Sanjay Baniwal


Advertisement
View Answers

May 2, 2012 at 3:01 PM


<%@page import="java.sql.*"%>
<form method="post" action="../Servlet">
<%
String driver = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://localhost:3306/register";
String query = "select * from register";
ResultSet rs = null;
Connection conn = null;
Statement stmt = null;
try {
Class.forName(driver);
conn=DriverManager.getConnection(url, "root", "root");

stmt = conn.createStatement();
rs = stmt.executeQuery(query);
%>
<select name="select">
<%
while(rs.next()){
%>
<option value="<%=rs.getInt("id")%>"> <%=rs.getString("username")%> </option>
<%
}
}
catch(Exception e){}
%>
</select>
<input type="submit" value="submit">
</form>

For more information, visit the following links:

http://www.roseindia.net/jsp/user-search.shtml

http://www.roseindia.net/jsp/comboSelect.shtml



May 2, 2012 at 4:52 PM


But sir i do not have the id column in my table than why we are writting getInt"id" in



May 2, 2012 at 4:54 PM




May 5, 2012 at 10:04 AM


Sir, It's been three days that i have not received any answer to my question that why we are writing getInt"id" in our code when i do not have any id column in my Account table.

Please sir reply as soon as possible.

with warm regards.



May 16, 2012 at 10:33 AM


Respected Sir, I think that you did not get my question or you are not interested in answering my question .

Please sir go to my questions as soon as possible.

with Warm Regards Sanjay Baniwal



Related Tutorials/Questions & Answers:
Important Question
Important Question  Respected Sir, I am Sanjay Baniwal working in BHEL as a Software Developer as a trainee for One Year. And i have been given a Project in which i have to create a JSP page with a Drop Down List in which all
Important Java Interview Question
Important Java Interview Question  Complete the Solver constructor so that a call to solveAll return a list with 2 values including the square root and the inverse of the integer passed as parameter. public interface
Advertisements
Important things in the Cloud Computing
Important things in the Cloud Computing  Hi, What are the Important things in the Cloud Computing? Thanks   Hi, Here is the list of important things in the Cloud Computing or the important skills necessary for Cloud
important for all beginers
important for all beginers  what is the difference for top down approach and bottom up approach with a example program of source code with clear explanation
question
question   sir plz tell me what should i give in title box. just i want java program for the question typed in this area
question
question   sir plz tell me what should i give in title box. just i want java program for the question typed in this area
Question
Question   When there is an exception in my program how java runtime system handles
question
question  dear sir/madam my question is how to compare two text format in java..we are java beginners..so we need the complete source code for above mentioned question...we have to compare each and every word
very important - Kindly help
very important - Kindly help   I am creating web page for form registration to my department ..I have to Reprint the Application Form (i.e Download the PDf File from the Database ) , when the user gives the Application number
Why application server is important?
Why application server is important?  Hi, I have to select the good application server for running my Java based web applications. Which application server or tomcat container is good to run the application. On my website
question
question  Dear sir i had some typing mistake at previous question so its my humble request to let me know the steps to start the tomcat6 under the tomcat directory
Important - Java Beginners
Important Character into string vaariable  How to store the character... = prabhu.charAt(15); char q = prabhu.charAt(16); char r = prabhu.charAt(17); char... upper16 = Character.toLowerCase(q); char upper17 = Character.toLowerCase(r
The ActionForm and what are important methods in ActionForm.
The ActionForm and what are important methods in ActionForm.  What is the ActionForm and what are important methods in ActionForm
question
question  Gud morning sir, I have asked u some question regarding jsp in saturaday for that i didnot find any answere in which u send me the some of the links.U have asked me the specify some details. There is a entity name
Question?
Question?  My question is how to: Add a menu bar to the program with a File menu. In the File menu, add a submenu (JMenuItem) called About. When the user clicks on the About menu item, display a JOptionPane message dialog
important topics to prepare for java interview
important topics to prepare for java interview  hi friends can anyone tell what are the important topics to prepare for java interview????   Each and every topic is important for an interview. You can find some
Class AsyncEvent important methods
In this section, you will learn about the important methods of AsyncEvent Class
AsyncContext Interface important methods
In this section , you will get to know about important methods of AsyncContext Interface
AsyncListener Interface important methods
In this section, you will get to know about important methods AsyncListener Interface
What is most important features of Java
What is most important features of Java  Hi, What is the most important features of Java? Thanks   Hi, The latest version of Java 7 having some most important features like Java virtual Machine, Language updates
What is the most important requirement for OLTP ?
What is the most important requirement for OLTP ?   What is the most important requirement for OLTP ?   Hi, In the transaction server..., supermarkets, and manufacturers. The most important point about oltp
JPQL helpppppp please very important
JPQL helpppppp please very important   there are 3 tables: book: isbn title loan: isbn borrowerId borrower: borrowerId FirstName LastName I want to write a JPQL Query that show only the Available books and not loaned
Outsourcing: The Most Important Questions - RoseIndia
Outsourcing: The Most Important Questions Introduction Outsourcing work is an important business decision that can make or mar your prospects... of the important components that help you to take the right decisions
important for all final years student
important for all final years student   i need a java program for my project, java program for getting path of the file in console while reading a file it should add page number in all pages after that delete all common letters
important for all final years student
important for all final years student  i need a java program for my project, java program for getting path of the file in console while reading a file it should add page number in all pages after that delete all common words
important for all final years student
important for all final years student  i need a java program for my project, java program for getting path of the file in console while reading a file it should add page number in all pages after that delete all common words
Searching For Important Issues for Writing Articles
Searching For Important Issues for Writing Articles  ... important issues depends on the following things: About what industry do you... naturally have a flair for writing about important issues and attaining major
Why Big Data is important for Enterprises?
is very important in managing the huge set of structured and un-structured... daily. So, its very important for the enterprises for gathering and analyzing.... These information are very important in deciding the business plans. There days Big Data
Important Interview Questions in Core Java
Important Interview Questions in Core Java Core Java refers... is a different. In any interview, a simple question can dooms the possibility of your... important feature of Java? Ans: Yes, It is a platform independent language, able
Advertisements
 

 

 

DMCA.com