Home Answers Viewqa Java-Beginners clarify my question

 
 


Karen
clarify my question
2 Answer(s)      2 years and 11 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.


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 Pages:
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
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 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
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
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
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
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
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
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
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 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
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 , 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?
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
/) 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.
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
Some additions for my previous question - Java Beginners
Some additions for my previous question  This is the question I posted several hours ago: "I'm trying to write a program that has a text field... for the GUI. Could anyone please help?" So my other two questions are: 1
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
PLEASE HELP WITH MY JAVA
PLEASE HELP WITH MY JAVA  Hey my name is Gavin and im a student at school that takes IT. my teacher has gave me a problem and i can't figure it out please help!!!!!!!! it is a for-loop question: Display the first 5 multiples
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
Paypal integration to my website - Struts
the payment details(acknowledgement)....My question is.....instead of getting...Paypal integration to my website  Hi there, I am working on paypal.My question is....I have one webiste and in that I kept a button called
Netbeans Question.
Netbeans Question.   Ok here is my code- * * To change this template, choose Tools | Templates * and open the template in the editor. */ import...]); } } } This is what I am trying to get my program to due- using a two-dimensional array
Android Question
Android Question  how can i use pre-defined table in my application
Zend question
Zend question  How to change action in zend framework?? suppose i want to add data in DB so my logic is that form view code in my indexAction() and insert process in addAction so how to go addAction() part in cilck on submit
java question
java question  i have a string like "My name is arvind.i live in bangalore.i study in college.".the problem is that i hav to break this string into three seperate lines
Jdbc Question
Jdbc Question  Hi. In Jdbc, if i am pointing to the database of some other machine, i mean instead of local-host i give the ip of that machine and that machine is shut down, Will my connection still work
JAVA QUESTION
THE DYNAVALIDATORACTIONFORM THIS WILL BE SUCCESFULL. NOW MY REQUIERMENT IS TO GET DATA FROM DATABASE
servlet question
servlet question  sir please provide a web apps program in which it has a button through which i can download my uploaded image.   Here is a code to upload and download the file. 1)page.jsp: <%@ page language="java
Addition to my previous post - Java Beginners
Addition to my previous post  Addition to my previous question about the address book program. I need to have separate classes: CmdLineAddressBook.java AddressBook.java Contact.java Address.java Name.java
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
question about database
question about database  sir i have made a drop down button using html..now i want to retrieve values from database so that they my appear in my drop down button..how can i do this....i have taken many fields such as type,ward id
doubt in my program code - Java Beginners
doubt in my program code  i have developed a web browser with the help of standard widget toolkit(swt) and java. i creted some buttons such as GO... we can see as the name of all the buttons.my question is i need to change
How to launch my web application from my desktop without opening Netbeans IDE everytime i run the application?
for my previous question but i knw how to create JSP pages, I have completed my web application, now my question is how can i start my web application, wat i mean...How to launch my web application from my desktop without opening Netbeans IDE
My Base Class is Changing every time in my code. How I can overcome this?
My Base Class is Changing every time in my code. How I can overcome this?  I have had the below question asked in interview, i'm curious to learn... by Generator. The question I was asked was about creating a new base class
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
string related question
string related question  *q.1>how i dispaly the reference of string variableS ? eg:-String s1="my name"; Sring s2="your name"; here what is address of variable s1 and s2
This Question was UnComplete - Java Beginners
This Question was UnComplete  Implement a standalone procedure to read in a file containing words and white space and produce a compressed version... preserve lines.  Hi Alhisnawy, Below is my version of code. Hope it fulfills

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.