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



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


manigandan
java html
6 Answer(s)      2 years and 8 months ago
Posted in : JSP-Interview Questions


program for jsp


Advertisement
View Answers

January 26, 2012 at 10:34 PM


<html>
<body>
    <select>
<option value="--Select--">--Select--</option>
    <%
    Statement st;
    ResultSet rs;
     try
     {
    String url="jdbc:mysql://localhost:3306/mobile";
    Class.forName("com.mysql.jdbc.Driver");
    Connection con=DriverManager.getConnection(url,"root","root123");
    st=con.createStatement();
    rs=st.executeQuery("select name from login");
    while(rs.next())
    {
String str=rs.getString("name");
%>
<option value="<%=str%>"><%=str%></option>
<%
}%></select>
    <%                
     }catch(Exception e)
     {
          out.println(e);
                 }
    %>
</body>
</html></body></html>


January 26, 2012 at 10:35 PM


<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> <link rel="stylesheet" type="text/css" href="StyleSheet1.css" /> <script lang="javascript"> function search() { window.location.href="search.jsp"; } </script> </head> <body> <form action="Third.jsp" class="txt"> <table border="2" align="center"> <tr><td>username</td><td><input type="text" name="user"/></td></tr> <tr><td>password</td><td><input type="Password" name="pass"/></td></tr> <tr><td><input type="submit" value="submit"/></td><td><input type="button" value="search" onclick="search()"/></td></tr> </table> <label for="name">male</label> </form> </body> </html>


January 26, 2012 at 10:36 PM


<html>
<head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
            <link rel="stylesheet" type="text/css" href="StyleSheet1.css" />
            <script lang="javascript">
            function search()
            {
            window.location.href="search.jsp";

            }
            </script>

</head>
<body>

    <form action="Third.jsp" class="txt">
        <table border="2" align="center">
            <tr><td>username</td><td><input type="text" name="user"/></td></tr>
            <tr><td>password</td><td><input type="Password" name="pass"/></td></tr>
            <tr><td><input type="submit" value="submit"/></td><td><input type="button" value="search" onclick="search()"/></td></tr>

        </table>
        <label for="name">male</label>
            </form>
             </body>
</html>


January 26, 2012 at 10:37 PM


<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
</head>
<body>
    <%

    Statement st;
    ResultSet rs;
     try
     {
    String url="jdbc:mysql://localhost:3306/mobile";
    Class.forName("com.mysql.jdbc.Driver");
    Connection con=DriverManager.getConnection(url,"root","root123");
    st=con.createStatement();
    rs=st.executeQuery("select name from login");
    %>
     <table border="2" align="center">
         <tr>
         <th>Name</th>
         <th>Password</th>
         </tr>
             <%
    while(rs.next())
     {
      %>

         <tr >
        <td><%=rs.getString(1)%></td>
          <td ><%=rs.getString(2)%></td>
          </tr>  

         <% 
     }
%>

</table>
    <%                
     }catch(Exception e)
     {
          out.println(e);
                 }
    %>
</body>
</html>


January 26, 2012 at 10:38 PM


<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <script lang="javascript">
            function view()
            {
                window.location.href="Fourth.jsp";
            }
        </script>
    </head>
    <body>


        <form action="Fourth.jsp">
            <input type="button" value="view" onClick="view()"/>        </form>
    </body>
</html


January 26, 2012 at 10:38 PM


<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script lang="javascript">
        </script>
    </head>
    <body>
        <form action="search.jsp">
        Search by Idc
        Id<input type="text" name="id"/>
        Search by Id
        Mobile<input type="text" name="mobile"/>
        <input type="submit" value="Go" />


        <%
Connection con;
Statement st;
ResultSet rs;
String id,mobile,qr;
int temp=0;
id=request.getParameter("id");
mobile=request.getParameter("mobile");
if(( id !=null && id!="") && (mobile != null && mobile!=""))
{
try
{
    String Url="jdbc:mysql://localhost:3306/mobile";
    Class.forName("com.mysql.jdbc.Driver");   
    con=DriverManager.getConnection(Url,"root","root123");
    st=con.createStatement();
    qr="select name from record where id='"+id+"'";
    rs=st.executeQuery(qr);
%>
        <table border="2" align="center">
             <tr>
             <th>Name</th>

             </tr>
                 <%
        while(rs.next())
         {
          %>

             <tr >
            <td><%=rs.getString(1)%></td>
              </tr>  

             <% 
         }
   %>

   </table>
        <%                
         }catch(Exception e)
         {
              out.println(e);
                     }
}
        %>


    </form>
    </body>
</html>


Related Tutorials/Questions & Answers:
java with html
java with html  actually we use html code in the java programs........ why we are using like please tell me the reason.. please reply me soon
JAVA with HTML
JAVA with HTML  Hello I want an JAVA example that would convert any UNICODE character OR STRING into its Equivalent HTML Numeric[ASCII] values... Like for character ? it's equivalent value is آ like all the other
Advertisements
java html
java html  program for jsp
java html
java html  program for jsp
java html
java html  program for jsp
java html
java html  program for jsp
java html
java html  program for jsp    --Select...-Type" content="text/html; charset=UTF-8"> <title>JSP Page<...;  <meta http-equiv="Content-Type" content="text/html; charset
Java HTML Client Application
Java HTML Client Application  Java HTML Client Application
Java to html - Java Beginners
, i need help for writing the results from the java application to the html file... in java to write data as html content. So write ur data with PrintWriter...Java to html   Hi , I have to compare two text files, and put
xml to html via java
xml to html via java  how to read xml into html using java code
html form - Java Beginners
html form  Hi
JAVA N HTML - JavaMail
JAVA N HTML  How to use HTML's mailto tag in a java application..., You can use mailto tag in Java Servlets like this: import java.io....,IOException{ response.setContentType("text/html"); PrintWriter pw
Java to extract info to HTML
Java to extract info to HTML  I need to write a java program..., into HTML format. I started by creating string instance variables for each... wrong? I am in an intro course to java so my knowledge of the language
Removing HTML from a Java String
Removing HTML from a Java String  Removing HTML from a Java String
html form - Java Beginners
html form  Hi, I wnt to design a form with more than one action in submit button.thanks. regards, sakthi  Hi friend, You specify your main requirement of form with more then one action. Thanks
HTML form - Java Beginners
HTML form   Hi, thank u for fast reply. I have two forms (form1 and form 2)with several fields in html. When i click the submit button, it validates all fields then moves to form2. i have a problem with form navigation. i
On HTML - Java Beginners
On HTML  Hi, This is Dedeepya.Most of you are aware of Yahoo Registration page(HTML).I have few doubts regarding that. 1.Username Text Box... to do this for each and every text box in my HTML page and also if the user
On HTML and JavaScript - Java Beginners
On HTML and JavaScript  Hi I have a SelectBox for ex i want to select a month from selectbox I want the default value of select box to be select but when user select the box for options then there should not be option called
html+css - Java Beginners
html+css   Cunningham Location Siteplan Lots News Contact us Premium Position Situated
html+css - Java Beginners
html+css   Akido NEXT EVENT: Radio InterviewMore Information Home Blog Music JOIN THE AKIDO TEAM
Converting HTML to image - Java Beginners
Converting HTML to image   Is it possible to convert html to image with java code ?   Hi friend, Please give the problem in details...://www.roseindia.net/java/ Thanks
html+css - Java Beginners
html+css   Davgan Financial Services //initialise plugins jQuery(function(){ jQuery('ul.sf-menu').superfish(); }); P 07 3399 1928 F 07 3395 8006 M 0402 341
Create HTML page using java
Create HTML page using java   Hi, I need to create an html page to export some information. Currently, by using java, i've exported information to excel. But now, I would like to view it in HTML instead of excel. Is there any
convert an pdf file to html in Java
convert an pdf file to html in Java  Hi all, How to convert an pdf file to html in Java? Currently all my data is generated into a report in pdf and i want to be able to generate it to html page as well. How to go about
Converting HTML to XML - Java Beginners
Converting HTML to XML  Hi, I am generating an HTML file (JSP from a Java Struts App.) I need to figure out a way to create an XML file from that HTML document. If you can refer me to some Java Code, that would
Java HTML scraping - Development process
Java HTML scraping   Is it possible to capture a page content from other website and include in our page dynamically
html parsing in java and display in swing
html parsing in java and display in swing  dear rose indians I am... HMTL pages in swing window forms to display html contents i am using JEditorPane control. Html contents is being is feteched from a local disc but links
convert Html to Xhtml - Java Beginners
convert Html to Xhtml  Hi All, I am trying to convert html to xhtml in java. to do this i am using htmlcleaner api. i am not able to do with it.i ve not even got basic example on that so please can u send some example
Html
Html  in the web page if judge select the age and category then automatically under that conditions the details will be display in the form of grid give me that code in html and java
Html
Html  i am select the dateofbirth through the html browser.but it can not save into the sql server 2008 database.any special code required to store the date in database by using java servlets
java html parsing - Development process
java html parsing  i want parse a html page and get all the tags... need to build a general tree by parsing the html page so any one can help me... HTML file,try the following code: import java.io.*; import javax.swing.
 

 

 

DMCA.com