Home Answers Viewqa JSP-Servlet Important Question

 
 


sanjay baniwal
Important Question
5 Answer(s)      a year 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

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 Pages:
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
Core Java Interview Question, Interview Question
Core Java Interview Question Page 12       Question: What is a transient variable? Answer: A transient variable is a variable that may not be serialized. Question: Which
Core Java Interview Question, Interview Question
Core Java Interview Question Page 2       Question: Does it matter... the IOException. Exception's subclasses have to be caught first. Question: Can an inner
Core Java Interview Question, Interview Question
Core Java Interview Question Page 32   ... Question: What is the ultimate ancestor of all java classes Answer: Object class is the ancestor of all the java classes Question: What
Core Java Interview Question, Interview Question
Core Java Interview Question Page 4       Question: What is the difference between checked... Question: Explain garbage collection ?  Answer: Garbage collection
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
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
Core Java Interview Question, Interview Question
Core Java Interview Question Page 9       Question: What are the uses of Serialization... the servers in a cluster. Question: what is a collection ?  Answer
Question
Question   When there is an exception in my program how java runtime system handles
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
Core Java Interview Question, Interview Question
Core Java Interview Question Page 5       Question: What are different types... } } ); Question: What are the uses of Serialization? Answer: In some types
Core Java Interview Question, Interview Question
Core Java Interview Question Page 7       Question: What... associated with TCP/IP socket. Question: What does the Serializable interface
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
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
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
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
Core Java Interview Question, Interview Question
Core Java Interview Question Page 10       Question: What is the difference between notify... by a call to notify (so it is often better to use notifyAll than notify). Question
Core Java Interview Question, Interview Question
Core Java Interview Question Page 6       Question: How can i tell what state a thread...++){ System.out.println(ts[i]); } } } Question: What methods java providing
Java interview question
) You should only take into account one payment per payment id. 5) Important...-explanatory. All the clues/notes above are important :) 6) Your tasks: Provide
Important - Java Beginners
Important Character into string vaariable  How to store the character variable into string format?  Hi friend,import java.io.*;import java.lang.*; public class nativeMethods{ public static void main(String args
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
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

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.