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



Home Answers Viewqa Java-Beginners clarify my question
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Karen
clarify my question
2 Answer(s)      4 years and 7 months ago
Posted in : Java Beginners


Dear Sirs/Expert,

Thanks for writing back.

Yes. I want a page to use id of parents to do the search for the match.

So, after enter the id of the parent into the search box, the table will display the matching tutors to the parent.

I was telling you that my degree is not a field on its own, it is under a drop down list where there is different types of qualification like degree, master, PHD etc.

So, if there is a tutor that match the parent requirements like qualification, subjects that the tutor can teach and the locations for example, there will be a table that display the following:-

parent id, contact, name,address,location, tutor id, name, contact, location

so, there might be different tutors that can match this parent's requirements and all the tutors' name, address, location, id and contact will be displayed to me.

The idea is that I need to find a match for the parent.

Is it have to use hibernate in order to achieve the above?

Thank you for your kind patience. I really appreciate it.



Advertisement
View Answers

June 17, 2010 at 4:08 PM


Hi Friend,

Try the following code:
<%@page import="java.sql.*"%>
<form>
Enter ID:<input type="text" name="id"><input type="submit" value="Submit" style="background-color:#49743D;font-weight:bold;color:#ffffff;">
</form>
<%String id=request.getParameter("id");
if(id!=null){
Class.forName("com.mysql.jdbc.Driver");
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql";, "root", "root");
Statement st=connection.createStatement();
ResultSet rs=st.executeQuery("SELECT * FROM parents where parentsID='"+id+"'");
%>
<table border="1">
<tr><th>Parents ID</th><th>Name</th><th>Contact No</th><th>Location</th><th>Tutors ID</th><th>Name</th><th>Contact No</th><th>Location</th></tr>
<%
String sub="",qua="";
while(rs.next()){
sub=rs.getString("strSub");
qua=rs.getString("strtutorType");
}
ResultSet res=st.executeQuery("SELECT * FROM parents,tutors WHERE tutors.strSubt = '"+sub+"' and tutors.strQualificationt = '"+qua+"' and parentsID='"+id+"' ");
while(res.next()){
%>
<tr><td><%=res.getString("parentsId")%></td><td><%=res.getString("name")%></td><td><%=res.getString("contactNo")%></td><td><%=res.getString("strLocation")%></td><td><%=res.getString("tutorsId")%></td><td><%=res.getString("tname")%></td><td><%=res.getString("tcontactNo")%></td><td><%=res.getString("strLocation1")%></td></tr><%
}
}
%>
</table>

Thanks


June 17, 2010 at 4:13 PM


For the above code, we have created following database table:

1)parents:

CREATE TABLE `parents` (
`parentsId` bigint(255) NOT NULL auto_increment,
`strSub` varchar(255) default NULL,
`strtutorType` varchar(255) default NULL,
`strLocation` varchar(255) default NULL,
`name` varchar(255) default NULL,
`address` varchar(255) default NULL,
`contactNo` int(255) default NULL,
`email` varchar(255) default NULL,
PRIMARY KEY (`parentsId`)
)

2)tutors:

CREATE TABLE `tutors` (
`tutorsId` bigint(255) NOT NULL auto_increment,
`strQualificationt` varchar(255) default NULL,
`strLocation1` varchar(255) default NULL,
`strSubt` varchar(255) default NULL,
`tname` varchar(255) default NULL,
`taddress` varchar(255) default NULL,
`tcontactNo` int(255) default NULL,
`temail` varchar(255) default NULL,
PRIMARY KEY (`tutorsId`)
)

Hope that it will be helpful for you.
Thanks


Related Tutorials/Questions & Answers:
clarify my question - Java Beginners
clarify my question  Dear Sirs/Expert, Thanks for writing back. Yes. I want a page to use id of parents to do the search for the match. So... the matching tutors to the parent. I was telling you that my degree
Clarify my last question's answer - Java Beginners
Clarify my last question's answer  Dear expert, I've tried out... did not specify my question too clearly. Here's my 2 database... and parents contain other fields like name, address, email, contact numbers etc. My
Advertisements
Please clarify my doubt
Please clarify my doubt  /here is my sample code for deadlock/ class A { synchronized void foo(B b) { String name...[] args) { new Deadlock(); } } My question is that class A has 2
Clarify my doubt - JSP-Servlet
Clarify my doubt  Hi All, Although i know the concept of Servlet & JSP, but I have never got a chance to work in EJB . So could u please tell me how to create web Project in netbeans and deploy it in tomcat AND/OR creating a web
my question
my question   "Write a C/C++ program to show the stored procedure PROCRESETMAIL" on database "USER_NOTIFY
my question
my question   "Write a C/C++ program to show the stored procedure PROCRESETMAIL" on database "USER_NOTIFY
please clarify regarding capacity method of my below string buffer class example
please clarify regarding capacity method of my below string buffer class example  hi here is the program below: > import java.lang.*; public... vinodaRajDeepakMohit vinodaRajDeepakMohitraju length is24 capacity is30 my question
solve my question shortly
solve my question shortly  <html> <head> <script> function checkphoneNumber(number){ if(/[^\d ]/.test(number)){ alert('It should contain numbers [0-9] only!'); document.getElementById
my question - EJB
my question  is it possiable to create web application using java beans & EJB's with out implementing Servlets and jsps in that java beans and EJB's
my question is related to my project viz
my question is related to my project viz   Sir, my project is based on MR tracking system developed using struts framework, it has been developed in Net Beans the whole project is working except a jsp page named dayplan.jsp
Regarding My 3rd Question in Java - Swing AWT
Regarding My 3rd Question in Java  sir in Netbeans By default JTable Columns will appear Horizontal like Title1 Title2 Title3 Title4 in below these our data will appear so my question that is there any method
clarify date class - Java Beginners
clarify date class  Dear, clarify this question... "Develop Date class in Java similar to the one available in java.util package. Use JavaDoc comments." Give me the source code and explain how to create classes similar
Some additions for my previous question - Java Beginners
Some additions for my previous question  This is the question I... for the GUI. Could anyone please help?" So my other two questions are: 1... the user with a command line menu. The choices are p, f, q and n. In case
Further advice needed on my last question - JSP-Servlet
Further advice needed on my last question  Dear Experts, I refer to your last solution regarding my matching codes. After I tried out your... errors Here are my codes which I modified but basically followed your logic
clarify bt/w service() and doget/dopost()
clarify bt/w service() and doget/dopost()   Dear friends, i ve question regarding service()and doget/dopost.. the container calls service() where it does the service for the request so then wat is the role of doget/dopost plz
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
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
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?  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
question
question  Sir , i have a starting trouble to start my search engine project , please help me to start my project , please send me some relevant java codes
QUESTION
QUESTION  please atach java tutorial to my email   Hello Friend, Please visit the following link: Java Tutorial Thanks
question
question  Sir, how to display web snippets for a perticular query for eg:web snippets for apple how to implement this concept in my java project please help me
question
question  i am using this code in my project response.sendRedirect("LoginForm1.jsp?msg=Username or Password is incorrect!"); but i wan't to hide this message from url.please help me
question
question  Sir, i am developing a video streaming PC server to j2me client system that the j2me player can playing video from PC server .if have any code for video streaming then send to my email address as soon as possible
question
to develop my java project
question
question  i need to mark employees as half day absent who came after 10'o clock in my web project,so i need to know who are all late entry.if you have any idea using jsp and mysql please help me
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
/) is not available.** how tdo i solve this.please help me to run my project please give
question
question  i am using this code in my project response.sendRedirect("LoginForm1.jsp?msg=Username or Password is incorrect!"); but i wan't to hide this message from url.please help me. you gave me the response Hi Jamsiya
Advertisements
 

 

 

DMCA.com