clarify my question

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, 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.


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(); }ADS_TO_REPLACE_1 } My question
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
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
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
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
ModuleNotFoundError: No module named 'Clarify'
ModuleNotFoundError: No module named 'Clarify'  Hi, My Python... 'Clarify' How to remove the ModuleNotFoundError: No module named 'Clarify... to install padas library. You can install Clarify python with following command
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
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
ModuleNotFoundError: No module named 'clarify_python'
ModuleNotFoundError: No module named 'clarify_python'  Hi, My... named 'clarify_python' How to remove the ModuleNotFoundError: No module named 'clarify_python' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'clarify_python_2'
ModuleNotFoundError: No module named 'clarify_python_2'  Hi, My... named 'clarify_python_2' How to remove the ModuleNotFoundError: No module named 'clarify_python_2' error? Thanks   Hi, In your
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
ModuleNotFoundError: No module named 'clarify_brightcove_sync'
ModuleNotFoundError: No module named 'clarify_brightcove_sync'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'clarify_brightcove_sync' How to remove the ModuleNotFoundError
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
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?  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  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  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  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, 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 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
to develop my java project
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
/) 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
question
question  following is my code to sent mail but i couldn't work with eclipse ,that have some errors .need i any set up in eclipse or tell to what can i do to work code properly. <%@ page import="java.io." import="java.lang.
question
;/tr> </table> this is my jsp page package servlet; import java.io.
ModuleNotFoundError: No module named 'Question'
ModuleNotFoundError: No module named 'Question'  Hi, My Python... 'Question' How to remove the ModuleNotFoundError: No module named 'Question... to install padas library. You can install Question python with following
to know my answer
to know my answer  hi, this is pinki, i can't solve my question "how to change rupee to dollar,pound and viceversa using wrapper class in java." will u help me
My SQL
My SQL  Connection class for MySQL in java
my project
my project   how to creat a e learnig site with student information , faculty details , student queries , student feedback, course information
Question on pooling
Question on pooling  which server supports pooling?Application server or web server
my assignment
my assignment  as programmer, you have been assigned to develop a user interface for a fats food ordering system.the interface should have various......this is my assignment....plz
my answer
my answer  import com.mysql.jdbc.Connection; import com.mysql.jdbc.Statement; import java.io.IOException; import java.io.PrintWriter; import java.sql.DriverManager; import java.sql.ResultSet; import
pl z provide code for below question in javascripr or jsp - JSP-Servlet
Friend, Please clarify your question. Thanks...pl z provide code for below question in javascripr or jsp  Once the parallel request happened, the user will not be able to continue his work, until
Query Question 2
Query Question 2  Want to displays the name and ID of all departments with the names of the employees in that department. SELECT * FROM employee is my result
This question in Jmeter
This question in Jmeter  hi..i want to send request(xml) 100 times but each time in request xml one element needs to change, otherwise request will be failed since its duplicate
Question on javascript
Question on javascript  This is not exactly what i wanted....If i enter in 2nd combobox as name of child then it should show child id in 1st combobox automatically and vice versa
C# question
Create a Solution by name Bank with Classes Account.cs, SavingsAccount.cs and savingsTest.cs to Demonstrate Abstract Classes in C#  1st question : Create a Solution by name Bank with Classes Account.cs, SavingsAccount.cs
question for c++
question for c++   write Program to swap between two numbers if first number is greater than second number and total of two numbers greater than 10

Ads