Ex---------------1

<html> <body> <p> <b>Some Popular Planets from Solar system</b> </p> <img src="C:\Documents and Settings\User\My Documents\My Pictures\solar system.jpg" width="145" height="126" usemap="#solarmap"> <map id="solarmap" name="solarmap"> <area shape="rect" coords="10,10,40,25" alt="Mercury" href="D:\\HTML_Examples\Mercury.html"> <area shape="rect" coords="35,20,75,55" alt="venus" href="D:\\HTML_Examples\venus.htm"> <area shape="rect" coords="65,55,115,85" alt="Earth" href="D:\\HTML_Examples\earth.htm"> <area shape="rect" coords="90,85,135,120" alt="Saturn"

href="D:\\HTML_Examples\saturn.htm">

</map>

<p><b>Note:</b> Some Planets from our solar system are displayed here click on any planet and you will get some useful information about them</p> </body> </html>

Ex---------------1

Ex---------------2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Embedded style sheet</title> <style type="text/css"> h1 { font-family:Arial; color:green } h2 { font-family:Arial;

color:red; left:20px } h3 { font-family:arial; color:blue; } p { font-size:14pt; font-family:verdana } </style> </head> <body> <h1> <center> This page is created using Embedded Style Sheet </center> </h1> <h2> This line is aligned left and red colored. </h2> <p> The embedded style sheet is the most commonly used style sheet.

. </h2> <p> The External style sheet is the compact representation of Cascading Style Sheets.org/TR/xhtml1/DTD/xhtml11.css" /> </head> <body> <h1 class="special"> <center> This page is created using External Style Sheet</center> </h1> <h2> This line is aligned left and red colored. </h3> </body> </html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1. </p> <h3> This is a blue <a href=”colorname.0 Transitional//EN" "http://www. This paragraph is written in Monotype Corsiva font with font size of 14.This paragraph is written in Verdana font with font size of 14.org/1999/xhtml"> <head> <link rel="stylesheet" type="text/css" href="ex1.dtd"> <html xmlns="http://www.html”>colored</a> line.w3.w3.

color:red. color:blue.The file name ex1..--> h1 { font-family:Arial } h2 { font-family:times new roman.css can be <!.</p> <h3> This is a blue <a href=”colorname. } p { font-size:14pt.html”>colored</a> line. .css and can be opened in notepad. </h3> </body> </html> The cascading style sheet ex1. left:20px } h3 { font-family:arial.

value.value. var name_str=document.value=="") { alert("Enter Some Age") return false } .ph_txt. if((name_str.name. var ph_str=document.value==null)||(name_str.font-family:Monotype Corsiva } Ex---------------2 Ex---------------3 <html> <head> <title>The Student Registration Form</title> <script type=text/javascript> function validate() { var i.my_form.my_form.value=="")) { alert("Enter some name") return false } if(document.Age_txt.my_form.Email_txt.ph_txt. var str=document.my_form.my_form. var phoneID=document.

Age_txt.charAt(i).length.Email_txt . if (((ch < "0") || (ch > "9"))){ alert("Invalid Phone Number") phoneID.length var index_dot=str.indexOf(".length<1 ||ph_str.length>11) { alert("Invalid length of Phone Number") return false } for (i = 0.Age_txt. i < ph_str. i++) { var ch = ph_str.my_form.value>"21")) { alert("Invalid Age") return false } if(ph_str.my_form.focus() return false } } var index_at=str.indexOf("@") var len=str.my_form.if((document.value<"5")&& (document.") var emailID=document.

value=="")) { alert("Please Enter your Email ID") emailID.value==null)||(emailID.")==index_at) { alert("Invalid E-mail ID") return false } if (str.if ((emailID.indexOf("@")==-1) { alert("Invalid E-mail ID") return false } if (str.indexOf(" ")!=-1) { alert("Invalid E-mail ID") .indexOf(".indexOf("@".")==0 || str.indexOf(".indexOf(".(index_at+1))!=-1) { alert("Invalid E-mail ID") return false } if (str.focus() return false } if (str.")==-1 || str.

group1[0]. return false. return false.checked && !document.checked && !document. } if (!document.group1[0].my_form.my_form.group1[0].group1[0].checked) { alert("Please Select Sex").return false } if (!document.my_form. } return true } </script> </head> <body bgcolor=aqua> <center><h3>Application Form</h3></center> <form name=my_form onsubmit=validate()> <strong>Name:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</strong> <input type=text name=name><br/> <strong>Age:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</stro ng> .checked) { alert("Please Select Sex").my_form.

V<br/> <br/><br/> <strong>Country:</strong> <select name="My_Menu"> <option value="India">India</option> <option value="China">China</option> <option value="Shrilanka">Shrilanka</option> </select> <center> <input type=submit value=Submit></br> </center> .">Watching T.V.<input type=text name=Age_txt><br/> <strong>Phone No:&nbsp</strong> <input type=text name=ph_txt><br/> <strong>Email:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</strong> <input type=text name=Email_txt><br/><br/> <strong>Sex:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp </strong> <input type="radio" name="group1" value="Male">Male&nbsp&nbsp&nbsp&nbsp <input type="radio" name="group1" value="Female">Female<br/><br/><br/> <strong>Hoby: </strong> &nbsp&nbsp <input type="checkbox" name ="option1" value="Singing">Singing<br/> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="checkbox" name ="option1" value="Reading">Reading<br/> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="checkbox" name ="option1" value="T.

/* <applet code="Experiment3" width=300 height=300> </applet> */ public class Experiment3 extends Applet implements ItemListener { int currcolor=5.awt. String text="Click any of the button".*. ."Green"."Blue".event.*.awt.applet. import java. import java.</body> </html> Ex---------------3 Ex---------------4 //This program changes the color of text //It also set the background color //It also loads the image //It makes use of checkboxgroup and button import java.*."Yellow". Button buttons[]=new Button[5]. int flag=1."Magenta"}. String colours[]={"Red".

addItemListener(this).false).setBackground(Color. box2.red).addItemListener(this).true).cbg.false). } buttons[0].magenta).Image img.i<5.setBackground(Color. box3.green). add(box3).setBackground(Color. } public void itemStateChanged(ItemEvent ev) { ").cbg.addItemListener(this). buttons[1].setBackground(Color. CheckboxGroup cbg=new CheckboxGroup().cbg. Checkbox box2=new Checkbox("Text Color". box1.setBackground(Color.yellow).i++) { buttons[i]=new Button(" add(buttons[i]). buttons[3]. . public void init() { for(int i=0. Checkbox box3=new Checkbox("Loading Image". Checkbox box1=new Checkbox("Background Color". buttons[2]. add(box1). add(box2).blue). buttons[4].

flag=3.jpg"). } else if(box3.30.getState()==true) flag=1.getState()==true) { img=getImage(getDocumentBase(). case 1: g.getState()==true) { text="Default color is black".setColor(Color."cutecat. } public void paint(Graphics g) { if(flag==2) { g.blue).setColor(Color. } repaint().100). flag=2.if(box1.red). else if(box2.drawString(text. switch(currcolor) { case 0: g. . break.

setColor(Color.setColor(Color. } g. break. case 1: setBackground(Color.yellow). case 2: g.blue).red). break.setColor(Color. . case 5: g. break.100).30. break. switch(currcolor) { case 0: setBackground(Color. } else if(flag==1) { g.drawString(text.drawString(text.black). case 4: g.green).break.100).setColor(Color.30. case 3: g. break.magenta).

i<5. break. break.20. } } public boolean action(Event e. case 2: setBackground(Color. case 3: setBackground(Color. case 5: setBackground(Color.magenta). case 4: setBackground(Color. break. } } else if(flag==3) { g.90.drawImage(img. break.i++) { if(e.yellow).white).Object o) { for(int i=0.this).target==buttons[i]) .break.green).

{ currcolor=i. text="You have chosen "+colours[i]. } } Ex---------------4 Ex---------------5 <html> <head> <title>Student Information Form</title> </head> <body> <center> <form name="form1" action="http://localhost:8080/examples/servlet/my_servletDemo"> <h3>Enter student information in following fields -</h3> <table> <tr> <td><b>Roll Number</b></td> . return true. repaint(). } } return false.

<td><input type="text" name="Roll Number" size="25" value=" "></td> </tr> <tr> <td><b>Student Name</b></td> <td><input type="text" name="Student Name" size="25" value=" "></td> </tr> <tr> <tr> <td><b>Student Address</b></td> <td><input type="text" name="Address" size="50" value=" "></td> </tr> <tr> <td><b>Phone</td> <td><input type="text" name="Phone" size="25" value=" "></td> </tr> <tr> <td><b>Total Marks</td> <td><input type="text" name="Total Marks" size="10" value=" "></td> </tr> </table> <input type="submit" value="submit"> .

getWriter(). import java. Enumeration en=req.close().util.servlet. out.getParameter(name_received).io.*. } out. } } .nextElement(). out. while(en. public class my_servletDemo extends GenericServlet { public void service(ServletRequest req.ServletResponse res) throws ServletException.getParameterNames().IOException { PrintWriter out=res.*.hasMoreElements()) { String name_received=(String)en. out.*. String value_received=req.println(value_received).println(" ").print(name_received+ " = "). import javax.</form> </center> </body> </html> import java.

if(ans1.ans2. Name = request.a3.ans4. " "). ResultSet rs=null. .JdbcOdbcDriver"). String ans1. Class.Name.sql.io.*" %> <%@ page import="java. Statement stmt=null.getParameter("group1"). ans1 =request. String url = "jdbc:odbc:StudentDB1".getConnection(url.equals("True")) a1=2. a1=a2=a3=a4=a5=0.util. connect = DriverManager.Ex---------------5 Ex---------------6 <%@ page language="java" import="java.getParameter("action")!=null) { SeatNum = request.ans5.odbc.ans3.*" %> <%@ page import="java.a4. " ".*" %> <% String SeatNum.forName("sun. if(request.getParameter("Name"). Connection connect=null.a2.jdbc. else a1=0.getParameter("Seat_no"). int a1.a5.

equals("True")) a5=0. ans3 = request. ans5 = request. if(ans5. int Total=a1+a2+a3+a4+a5.equals("True")) a2=0. '"+Total+ "')". stmt = connect.ans2 = request. String query = "INSERT INTO StudentTable (" + "Seat_no.close(). if(ans3. . else a3=2.equals("True")) a3=0. '" + Name + "'. int result = stmt. else a4=0. if(ans2. stmt. if(ans4.getParameter("group5"). else a5=2.equals("True")) a4=2. else a2=2.getParameter("group4").getParameter("group2").executeUpdate(query).createStatement().Name. ans4 = request.getParameter("group3").Marks" + ") VALUES ('" +SeatNum + "'.

stmt = connect. rs = stmt.next()) { %> <tr> <td><%=rs.executeQuery(query).createStatement(). %> <html><head><title>Student Mark List</title></head> <body bgcolor=khaki> <center> <h2>Students Marksheet</h2> <h3>Name of the College:ABC College of Engineering</h3> <table border="1" cellspacing="0" cellpadding="0"> <tr> <td><b>Seat_No</b></td> <td><b>Name</b></td> <td><b>Marks</b></td> </tr> <% while(rs.getString(3)%></td> </tr> <% } . query = "SELECT * FROM StudentTable WHERE Name="+"'"+Name+"'".getString(2)%></td> <td> <%=rs.getInt(1)%></td> <td> <%=rs.

.Seat_no.1:8080/jsp-examples/StudExam/Exam.rs.close().util.jsp">Click here to go back</a> </body> </html> <%}else{%> <html> <head><title>Online Examination</title> <script language="javascript"> function validation(Form_obj) { if(Form_obj. %> </table> </center> <br/> <br/><br/> <table> <tr><td><b>Date:<%=new java.focus().fill up the Seat Number").0.close(). stmt. connect.0. Form_obj.Z.toString() %></td></tr> <tr><td><b>Signature: X.close().length==0) { alert("Please.Y. <b></td></tr> </table> <div> <a href="http://127.value.Date().Seat_no.

return false.fill up the Name"). Form_obj. } return true.Name.Name.value.jsp" method="post" name="entry" onSubmit="return validation(this)"> <input type="hidden" value="list" name="action"> <table> <tr> <td><h3>Seat Number:</h3></td> <td><input type="text" name="Seat_no"></td> </tr> <tr> <td><h3>Name:</h3></td> . } if(Form_obj. return false. } </script> </head> <body bgcolor=lightgreen> <center> <h1>OnLine Examination</h1> </center> <form action="Exam.focus().length==0) { alert("Please.

Tim-Berner Lee is the originator of Java.</b><br/> <input type="radio" name="group2" value="True">True <input type="radio" name="group2" value="False">False<br> <br/> <b>3.</b></td> </tr> </table> <hr/> <b>1. Apache is an open source web server</b><br/> <input type="radio" name="group1" value="True">True <input type="radio" name="group1" value="False">False<br> <br/> <b>2. In Modern PC there is no cache memory.JPG is not a video file extension.</b><br/> <input type="radio" name="group3" value="True">True <input type="radio" name="group3" value="False">False<br> <br/> <b>4.<td><input type="text" name="Name" size="50"></td> </tr> <hr/> <tr> <td><b>Total Marks:10(Each question carries equal marks) </b></td> <td></td><td></td><td></td><td><b>Time: 15 Min.</b><br/> .

0" encoding="UTF-8"?> <Student> <?xml-stylesheet type="text/xsl" href="SimpleXml. HTTP is a statefull protocol</b><br/> <input type="radio" name="group5" value="True">True <input type="radio" name="group5" value="False">False<br> <hr/> <center> <input type = "submit" value="Submit"> <input type = "reset" value="Clear"><br><br> </center> </form> <%}%> Student.<input type="radio" name="group4" value="True">True <input type="radio" name="group4" value="False">False<br> <br/> <b>5.db: contact:precisshadow@aol.com Ex---------------6 Ex---------------7 <?xml version="1.xsl"?> <Person-Details> <name>Anand</name> <address>Pune</address> .

0" ?> <student> .<std>Second</std> <marks>70 percent</marks> </Person-Details> <Person-Details> <name>Anuradha</name> <address>Chennai</address> <std>Second</std> <marks>90 percent</marks> </Person-Details> <Person-Details> <name>Archana</name> <address>Mumbai</address> <std>Forth</std> <marks>80 percent</marks> </Person-Details> <Person-Details> <name>Monika</name> <address>Delhi</address> <std>Tenth</std> <marks>77 percent</marks> </Person-Details> </Student> <?xml version="1.

<Roll_No>10</Roll_No> <Personal_Info> <Name>Parth</Name> <Address>Pune</Address> <Phone>1234567890</Phone> </Personal_Info <class>Second</class> <Subject>Mathematics</Subject> <Marks>100</Marks> </student> <?xml version="1.0" ?> <student> <Roll_No>10</Roll_No> <Personal_Info> <Name>Parth</Name> <Address>Pune</Address> <Phone>1234567890</Phone> </Personal_Info> <class>Second</class> <Subject>Mathematics</Subject> <Marks>100</Marks> <Roll_No>20</Roll_No> <Personal_Info> <Name>Anuradha</Name> .

*.w3c.*.xml.parsers. import org. import org. import javax. .dom.<Address>Banglore</Address> <Phone>90901233</Phone> </Personal_Info> <class>Fifth</class> <Subject>English</Subject> <Marks>90</Marks> <Roll_No>30</Roll_No> <Personal_Info> <Name>Anand</Name> <Address>Mumbai</Address> <Phone>90901256</Phone> </Personal_Info> <class>Fifth</class> <Subject>English</Subject> <Marks>90</Marks> </student> Ex---------------7 Ex---------------8 import java.*.sax.*.xml.io.

in)).public class Parsing_DOMDemo { static public void main(String[] arg) { try { System. InputSource ip_src = new InputSource(file_name).print("Enter the name of XML document ").newDocumentBuilder().out. DocumentBuilder builder = Factory_obj. Document doc = builder. String file_name = input.parse(ip_src).newInstance(). BufferedReader input = new BufferedReader(new InputStreamReader(System. . if(fp. File fp = new File(file_name). } catch (Exception e) { System.out.out. System.println(file_name + " is well-formed!").println(file_name + " isn't wellformed!").exists()) { try { DocumentBuilderFactory Factory_obj = DocumentBuilderFactory.readLine().

*. } } catch(IOException ex) { ex. import org. public class Parsing_SAXDemo { public static void main(String[] args) throws IOException { try { System. } } } import java.xml.System.out. .printStackTrace().*.io. } } else { System.*.exit(1).sax.helpers. import org.out.xml.print("File not found!").sax.print("Enter the name of XML document ").

").createXMLReader().in)). String file_name = input.exit(1).out. reader. } } catch (IOException ex){ex.println("File is not present: " + file_name).printStackTrace(). File fp = new File(file_name).readLine(). System.println(file_name + " is well-formed."). if (fp.out.} . System.parse(file_name). } catch (Exception e) { System.BufferedReader input = new BufferedReader(new InputStreamReader(System.exists()) { try { XMLReader reader = XMLReaderFactory. } } else { System.println(file_name + " is not wellformed.out.

} else if (window.XMLHttpRequest) { XMLHttpRequestObject = new XMLHttpRequest().} } Ex---------------8 Ex---------------9 (only for IT) <html> <head> <title>Using multiple XMLHttpRequest objects</title> <script language = "javascript"> function getData(dataSource) { var XMLHttpRequestObject = false. dataSource).XMLHTTP"). .open("GET".ActiveXObject) { XMLHttpRequestObject = new ActiveXObject("Microsoft. if (window. } if(XMLHttpRequestObject) { XMLHttpRequestObject.

responseText.status == 200) { document.onreadystatechange = function() { if (XMLHttpRequestObject. XMLHttpRequestObject = null.txt')"> <input type = "button" value = "Display Message 2" . } } XMLHttpRequestObject.send(null). } } </script> </head> <body> <H1>Using multiple XMLHttpRequest objects</H1> <form> <input type = "button" value = "Display Message" onclick = "getData('data.XMLHttpRequestObject.innerHTML = XMLHttpRequestObject. delete XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.getElementById("targetDiv").

</p> </div> </body> </html> Ex---------------9 (only for IT) Ex---------------10 package airinfo. import java.Remote { public String getInfo(String src. public class TestDB implements MyInterface . import java.rmi.sql.String dest)throws java.*.rmi.rmi.RemoteException. } package airinfo. public interface MyInterface extends java.txt')"> </form> <div id="targetDiv"> <p>The fetched data will go here.onclick = "getData('data2.RemoteException.

createStatement(). } else if(src.forName("sun.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Mumbai' AND Dest='Chennai'"). Statement s=con.""). else if(dest.String dest) { String str="".equals("Pune")) { if(dest.equals("Chennai")) s. if(src.odbc.equals("Mumbai")) s.equals("Chennai")) .equals("Chennai")) s. Connection con=DriverManager.jdbc.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Pune' AND Dest='Chennai'"). } else if(src. try { Class.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Mumbai' AND Dest='Pune'").{ public String getInfo(String src."".equals("Mumbai")) { if(dest.getConnection("jdbc:odbc:Airways".equals("Pune")) s.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Pune' AND Dest='Mumbai'"). else if(dest.JdbcOdbcDriver").

} ResultSet rs=s.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Chennai' AND Dest='Mumbai'"). str+=rs. str+="</tr></b>".{ if(dest. str+="</td>". }catch(ClassNotFoundException ex) { System.println(ex). } str+="</table>". str+="<td>". else if(dest. str+="<table border=1>". while(rs. } .next()) { str+="<tr><b>". str+=rs.out. str+="</td>".executeQuery("SELECT * FROM Airways_table WHERE Start_from='Chennai' AND Dest='Pune'").getResultSet().equals("Pune")) s.getString("name"). str+="<td>".equals("Mumbai")) s.getString("Time").

Connection con=DriverManager.forName("sun. else if(dest.jdbc.println(ex).createStatement(). } return str. public class TestDB implements MyInterface { public String getInfo(String src.getConnection("jdbc:odbc:Airways".equals("Mumbai")) { if(dest."".catch(SQLException ex) { System.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Mumbai' AND Dest='Pune'").out.String dest) { String str="". import java. } } package airinfo.JdbcOdbcDriver").sql. try { Class."").*.equals("Pune")) s. if(src. Statement s=con.odbc.equals("Chennai")) .

executeQuery("SELECT * FROM Airways_table WHERE Start_from='Mumbai' AND Dest='Chennai'"). } else if(src.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Chennai' AND Dest='Pune'").getResultSet().executeQuery("SELECT * FROM Airways_table WHERE Start_from='Chennai' AND Dest='Mumbai'").executeQuery("SELECT * FROM Airways_table WHERE Start_from='Pune' AND Dest='Chennai'").equals("Pune")) { if(dest. str+="<table border=1>". else if(dest.next()) { str+="<tr><b>".equals("Pune")) s.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Pune' AND Dest='Mumbai'").equals("Chennai")) s. while(rs.getString("name").s. str+="<td>". } ResultSet rs=s.equals("Mumbai")) s.equals("Mumbai")) s.equals("Chennai")) { if(dest. . } else if(src. str+=rs. else if(dest.

str+="</td>"; str+="<td>"; str+=rs.getString("Time"); str+="</td>"; str+="</tr></b>"; } str+="</table>";

}catch(ClassNotFoundException ex) { System.out.println(ex); } catch(SQLException ex) { System.out.println(ex); } return str; } } package airinfo; import java.sql.*; public class TestDB implements MyInterface { public String getInfo(String src,String dest) { String str="";

try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Airways","",""); Statement s=con.createStatement(); if(src.equals("Mumbai")) { if(dest.equals("Pune")) s.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Mumbai' AND Dest='Pune'"); else if(dest.equals("Chennai")) s.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Mumbai' AND Dest='Chennai'"); } else if(src.equals("Pune")) { if(dest.equals("Mumbai")) s.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Pune' AND Dest='Mumbai'"); else if(dest.equals("Chennai")) s.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Pune' AND Dest='Chennai'"); } else if(src.equals("Chennai")) { if(dest.equals("Pune")) s.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Chennai' AND Dest='Pune'");

else if(dest.equals("Mumbai")) s.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Chennai' AND Dest='Mumbai'"); } ResultSet rs=s.getResultSet(); str+="<table border=1>"; while(rs.next()) { str+="<tr><b>"; str+="<td>"; str+=rs.getString("name"); str+="</td>"; str+="<td>"; str+=rs.getString("Time"); str+="</td>"; str+="</tr></b>"; } str+="</table>";

}catch(ClassNotFoundException ex) { System.out.println(ex); } catch(SQLException ex) { System.out.println(ex); }

Connection con=DriverManager. try { Class. import java.String dest) { String str="".getConnection("jdbc:odbc:Airways"."". } } package airinfo.JdbcOdbcDriver").odbc.equals("Pune")) .equals("Pune")) s. if(src.return str.forName("sun."").jdbc.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Mumbai' AND Dest='Chennai'"). public class TestDB implements MyInterface { public String getInfo(String src.sql. else if(dest. } else if(src.createStatement().equals("Chennai")) s.*.equals("Mumbai")) { if(dest. Statement s=con.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Mumbai' AND Dest='Pune'").

{ if(dest.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Chennai' AND Dest='Pune'").executeQuery("SELECT * FROM Airways_table WHERE Start_from='Chennai' AND Dest='Mumbai'").equals("Mumbai")) s.equals("Pune")) s.equals("Chennai")) { if(dest.getString("name"). str+="<table border=1>". str+="<td>". else if(dest.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Pune' AND Dest='Mumbai'"). str+="</td>". str+=rs.equals("Mumbai")) s. } ResultSet rs=s.getString("Time").next()) { str+="<tr><b>". else if(dest.getResultSet(). } else if(src.equals("Chennai")) s.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Pune' AND Dest='Chennai'"). str+=rs. str+="<td>". . str+="</td>". while(rs.

println(ex). } return str.out.JdbcOdbcDriver"). } } package airinfo. } str+="</table>".sql. }catch(ClassNotFoundException ex) { System. .*.String dest) { String str="".str+="</tr></b>".println(ex). try { Class. public class TestDB implements MyInterface { public String getInfo(String src.out.jdbc. } catch(SQLException ex) { System.odbc.forName("sun. import java.

else if(dest. Statement s=con. } else if(src.equals("Mumbai")) s.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Mumbai' AND Dest='Chennai'"). if(src. } else if(src.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Pune' AND Dest='Mumbai'"). else if(dest.""). else if(dest."".equals("Chennai")) { if(dest.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Mumbai' AND Dest='Pune'").getConnection("jdbc:odbc:Airways".executeQuery("SELECT * FROM Airways_table WHERE Start_from='Chennai' AND Dest='Mumbai'").Connection con=DriverManager.equals("Mumbai")) s.equals("Chennai")) s.equals("Pune")) s.equals("Pune")) s.equals("Pune")) { if(dest. } .executeQuery("SELECT * FROM Airways_table WHERE Start_from='Pune' AND Dest='Chennai'").createStatement().equals("Chennai")) s.equals("Mumbai")) { if(dest.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Chennai' AND Dest='Pune'").

} str+="</table>".out. } return str. str+=rs.ResultSet rs=s.println(ex).out. str+="<td>". str+="<td>". } } .getString("name"). while(rs.getResultSet().getString("Time"). str+="</td>".println(ex). str+="</td>".next()) { str+="<tr><b>". str+="<table border=1>". str+=rs. } catch(SQLException ex) { System. str+="</tr></b>". }catch(ClassNotFoundException ex) { System.

Connection con=DriverManager.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Mumbai' AND Dest='Chennai'").equals("Mumbai")) { if(dest. Statement s=con. } else if(src. if(src.equals("Pune")) s.package airinfo.createStatement().getConnection("jdbc:odbc:Airways".equals("Pune")) { ."").JdbcOdbcDriver").forName("sun."". import java.*.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Mumbai' AND Dest='Pune'"). else if(dest.sql. try { Class.odbc.String dest) { String str="". public class TestDB implements MyInterface { public String getInfo(String src.jdbc.equals("Chennai")) s.

} ResultSet rs=s. .executeQuery("SELECT * FROM Airways_table WHERE Start_from='Pune' AND Dest='Mumbai'"). str+="<table border=1>". else if(dest.equals("Chennai")) s. str+=rs.getString("name"). str+="<td>". else if(dest.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Pune' AND Dest='Chennai'").equals("Mumbai")) s.if(dest.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Chennai' AND Dest='Mumbai'"). str+="</td>".equals("Chennai")) { if(dest.getString("Time"). str+="</tr></b>". str+=rs. while(rs.equals("Mumbai")) s. } else if(src.getResultSet().executeQuery("SELECT * FROM Airways_table WHERE Start_from='Chennai' AND Dest='Pune'").equals("Pune")) s. str+="<td>". str+="</td>".next()) { str+="<tr><b>".

println(ex). build R1) // Generated source version: 1.3. .out.*.rpc. // JAX-RPC Standard Implementation (1.BasicService.1.xml.println(ex). import com. // Contents subject to change without notice.sun. } return str.3 package myairreservationclient. } } // This class was generated by the JAXRPC SI.client.sun.encoding. do not edit.out.xml. } catch(SQLException ex) { System.1. import com.rpc. }catch(ClassNotFoundException ex) { System.} str+="</table>".

wsdl.rpc.NS_SOAP_ENCODING).encoding.*.rpc. TypeMapping mapping12 = registry. .getTypeMapping(SOAP12Constants. import com.QName. import javax.rpc.literal. import javax.xml.encoding. { QName type = new QName("http://tempuri.xml.sun.org/wsdl".getTypeMapping(SOAPConstants.namespace.simpletype.encoding.*.rpc.*.NS_SOAP_ENCODING).SOAPVersion. TypeMapping mapping2 = registry.xml.schema. import com.xml.encoding.*. SOAPConstants. "getInfo").getTypeMapping("").sun.xml.rpc.xml.SchemaConstants.rpc. import com.xml.NS_SOAP_ENCODING). DONT_ENCODE_TYPE. import javax.soap.sun. public class AirLineReservation_SerializerRegistry implements SerializerConstants { public AirLineReservation_SerializerRegistry() { } public TypeMappingRegistry getRegistry() { TypeMappingRegistry registry = BasicService.MyInterface_getInfo_RequestStruct_SOAPSerializer(type.*.rpc.document. import com.sun.import com. CombinedSerializer serializer = new myairreservationclient.createStandardTypeMappingRegistry().xml. NULLABLE. TypeMapping mapping = registry.soap.sun.

SOAPVersion. new SingletonSerializerFactory(ser). CombinedSerializer serializer = new myairreservationclient. } } . serializer.class.MyInterface_getInfo_ResponseStruct_SOAPSerializer(type. Serializer ser) { mapping. registerSerializer(mapping.register(javaType. serializer). serializer. registerSerializer(mapping. } { QName type = new QName("http://tempuri.QName xmlType.MyInterface_getInfo_Resp onseStruct. NULLABLE.namespace.MyInterface_getInfo_Requ estStruct. new SingletonDeserializerFactory((Deserializer)ser)). } return registry.SOAP_11).class. serializer). type.xml.serializer = new ReferenceableSerializerImpl(DONT_SERIALIZE_AS_REF. } private static void registerSerializer(TypeMapping mapping.NS_SOAP_ENCODING). xmlType.org/wsdl". SOAPConstants. serializer = new ReferenceableSerializerImpl(DONT_SERIALIZE_AS_REF.SOAP_11). java. javax.myairreservationclient.myairreservationclient. "getInfoResponse").lang. DONT_ENCODE_TYPE. type. SOAPVersion.Class javaType.

import com.sun.sun.xml.SchemaConstants.sun.rpc.3.soap.QName. import javax.namespace.rpc.wsdl. .*.document.simpletype.schema.*.rpc.BasicService.// This class was generated by the JAXRPC SI. import com.xml.encoding.xml.literal.*.soap.*.1.rpc.createStandardTypeMappingRegistry().xml.encoding.*.rpc.xml.xml.encoding.xml.encoding.xml. import com.encoding. do not edit. import javax.rpc.sun.client.sun. import com. import com.rpc.sun.rpc.xml.*. import com.1. // Contents subject to change without notice. import com.xml. public class AirLineReservation_SerializerRegistry implements SerializerConstants { public AirLineReservation_SerializerRegistry() { } public TypeMappingRegistry getRegistry() { TypeMappingRegistry registry = BasicService.SOAPVersion.sun. // JAX-RPC Standard Implementation (1. import javax. build R1) // Generated source version: 1.rpc.3 package myairreservationclient.

xml. javax. serializer.MyInterface_getInfo_RequestStruct_SOAPSerializer(type. TypeMapping mapping2 = registry. SOAPVersion.getTypeMapping(SOAP12Constants.NS_SOAP_ENCODING).NS_SOAP_ENCODING). { QName type = new QName("http://tempuri.namespace. NULLABLE. } return registry. java.TypeMapping mapping12 = registry.Class javaType.NS_SOAP_ENCODING). registerSerializer(mapping. type.getTypeMapping(SOAPConstants. serializer). DONT_ENCODE_TYPE. SOAPConstants.getTypeMapping("").lang. } { QName type = new QName("http://tempuri. } private static void registerSerializer(TypeMapping mapping. CombinedSerializer serializer = new myairreservationclient. serializer = new ReferenceableSerializerImpl(DONT_SERIALIZE_AS_REF.SOAP_11).myairreservationclient. "getInfo"). registerSerializer(mapping. CombinedSerializer serializer = new myairreservationclient. NULLABLE.class.SOAP_11).class.org/wsdl".QName xmlType. . type. "getInfoResponse"). SOAPConstants. serializer.org/wsdl". SOAPVersion. DONT_ENCODE_TYPE.myairreservationclient.MyInterface_getInfo_Requ estStruct.MyInterface_getInfo_ResponseStruct_SOAPSerializer(type. serializer = new ReferenceableSerializerImpl(DONT_SERIALIZE_AS_REF.MyInterface_getInfo_Resp onseStruct.NS_SOAP_ENCODING). TypeMapping mapping = registry. serializer).

String result. // Contents subject to change without notice.1. do not edit. new SingletonDeserializerFactory((Deserializer)ser)). } } // This class was generated by the JAXRPC SI. new SingletonSerializerFactory(ser).register(javaType.Serializer ser) { mapping. public class MyInterface_getInfo_ResponseStruct { protected java. build R1) // Generated source version: 1.lang.lang.3.1. // JAX-RPC Standard Implementation (1. } . public MyInterface_getInfo_ResponseStruct() { } public MyInterface_getInfo_ResponseStruct(java.3 package myairreservationclient. xmlType.String result) { this.result = result.

1.result = result. .String result) { this.rpc.sun.*.String getResult() { return result.lang.lang.1.3 package myairreservationclient.lang. do not edit.LocalizableExceptionAdapter.encoding. import com. } public void setResult(java. private java. // Contents subject to change without notice.String string_2.rpc. public class MyInterface_getInfo_RequestStruct_SOAPBuilder implements SOAPInstanceBuilder { private myairreservationclient. build R1) // Generated source version: 1. // JAX-RPC Standard Implementation (1.String string_1.exception. import com.xml.util.MyInterface_getInfo_RequestStruct _instance.lang. } } // This class was generated by the JAXRPC SI. private java.sun.xml.public java.3.

String string_2) { this. } public int memberGateType(int memberIndex) { switch (memberIndex) { case mySTRING_1_INDEX: return GATES_INITIALIZATION | REQUIRES_CREATION.String string_1) { this. case mySTRING_2_INDEX: return GATES_INITIALIZATION | REQUIRES_CREATION. private static final int mySTRING_2_INDEX = 1.private static final int mySTRING_1_INDEX = 0. } } public void construct() { .lang. public MyInterface_getInfo_RequestStruct_SOAPBuilder() { } public void setString_1(java.string_1 = string_1.lang. } public void setString_2(java.string_2 = string_2. default: throw new IllegalArgumentException().

lang. break.IllegalArgumentException(). default: throw new java. } } public void initialize() { } .lang. break.lang.Exception e) { throw new DeserializationException(new LocalizableExceptionAdapter(e)). } } catch (java.lang. case mySTRING_2_INDEX: _instance.lang.} public void setMember(int index.lang.RuntimeException e) { throw e.Object memberValue) { try { switch(index) { case mySTRING_1_INDEX: _instance. java.String)memberValue). } catch (java.setString_2((java.setString_1((java.String)memberValue).

String getInfo(java.Object getInstance() { return _instance. public interface MyInterface extends java.Remote { public java.Object instance) { _instance = (myairreservationclient. do not edit. } // This class was generated by the JAXRPC SI. build R1) // Generated source version: 1.1.RemoteException.rmi.lang. // Contents subject to change without notice. // JAX-RPC Standard Implementation (1.lang. } public java.String string_1.public void setInstance(java.3.lang.lang. .3 package myairreservationclient.lang. } } // This class was generated by the JAXRPC SI. java.String string_2) throws java.1. do not edit.MyInterface_getInfo_RequestStruct)instance.rmi.

xml.*. import javax. public AirLineReservation_Impl() { super(serviceName.ServiceExceptionImpl.encoding. import javax. import javax. import com.xml. import javax.sun.class.xml.sun.rpc.client.xml.util.sun.rpc.*.// Contents subject to change without notice. import javax.client. import com.org/wsdl". private static final QName ns1_MyInterfacePort_QNAME = new QName("http://tempuri. build R1) // Generated source version: 1.xml.rpc.BasicService implements AirLineReservation { private static final QName serviceName = new QName("http://tempuri.sun.SOAPVersion. public class AirLineReservation_Impl extends com.sun.client.xml.3 package myairreservationclient.handler.xml.handler.QName.rpc. import com.rpc.rpc.3.namespace. import com.rpc.*. "MyInterfacePort").rpc.exception.*.1.HandlerChain. new QName[] { .MyInterface.soap.xml.rpc.HandlerChainImpl.xml.xml.HandlerInfo.1.encoding. // JAX-RPC Standard Implementation (1. import com.rpc. "AirLineReservation").xml.org/wsdl".sun. private static final Class myInterface_PortClass = myairreservationclient.

equals(myInterface_PortClass)) { return getMyInterfacePort().Class serviceDefInterface) throws javax. java.ns1_MyInterfacePort_QNAME }. new myairreservationclient.AirLineReservation_SerializerRegistry().QName portName. } return super. serviceDefInterface).xml.getPort(portName.Class serviceDefInterface) throws javax.rpc.lang.equals(ns1_MyInterfacePort_QNAME) && serviceDefInterface.rmi. } } catch (Exception e) { throw new ServiceExceptionImpl(new LocalizableExceptionAdapter(e)).getRegistry()).Remote getPort(javax.rpc.ServiceException { try { if (serviceDefInterface.xml.rmi.namespace.equals(myInterface_PortClass)) { return getMyInterfacePort(). } } catch (Exception e) { . } public java.xml.lang.Remote getPort(java. } public java.ServiceException { try { if (portName.

} public myairreservationclient.String[] {}._initialize(super.setRoles(roles).String[] roles = new java.lang. handlerChain.getPort(serviceDefInterface).internalTypeRegistry). } } Ex---------------10 .getHandlerChain(ns1_MyInterfacePort_QNA ME)).MyInterface_Stub(handlerChain).lang.MyInterface getMyInterfacePort() { java. myairreservationclient. e). try { stub. } catch (JAXRPCException e) { throw e. } return stub.MyInterface_Stub stub = new myairreservationclient.throw new ServiceExceptionImpl(new LocalizableExceptionAdapter(e)). } catch (Exception e) { throw new JAXRPCException(e.getMessage(). } return super. HandlerChainImpl handlerChain = new HandlerChainImpl(getHandlerRegistry().

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.